Change CB initialization
This commit is contained in:
parent
2b15168983
commit
ae9fc14795
@ -30,7 +30,7 @@ def parse_args():
|
||||
|
||||
def main():
|
||||
args = parse_args()
|
||||
cb = cloud_build.CB(args)
|
||||
cb = cloud_build.CB(config=args.config, no_tests=args.no_tests)
|
||||
cb.create_images()
|
||||
cb.copy_external_files()
|
||||
cb.sign()
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
from typing import Dict, List, Any, Union
|
||||
from typing import Dict, List, Union
|
||||
|
||||
from pathlib import Path
|
||||
import contextlib
|
||||
@ -29,12 +29,17 @@ class Error(Exception):
|
||||
class CB:
|
||||
"""class for building cloud images"""
|
||||
|
||||
def __init__(self, args: Any) -> None:
|
||||
def __init__(
|
||||
self,
|
||||
config,
|
||||
no_tests=False,
|
||||
create_remote_dirs=False
|
||||
) -> None:
|
||||
self.initialized = False
|
||||
self._save_cwd = os.getcwd()
|
||||
self.parse_config(args.config)
|
||||
self.no_tests = getattr(args, 'no_tests', False)
|
||||
self._create_remote_dirs = getattr(args, 'create_remote_dirs', False)
|
||||
self.parse_config(config)
|
||||
self.no_tests = no_tests
|
||||
self._create_remote_dirs = create_remote_dirs
|
||||
|
||||
data_dir = (Path(self.expand_path(os.getenv('XDG_DATA_HOME',
|
||||
'~/.local/share')))
|
||||
|
@ -1,6 +1,5 @@
|
||||
from contextlib import ExitStack
|
||||
from pathlib import Path
|
||||
from types import SimpleNamespace
|
||||
from unittest import TestCase
|
||||
from unittest import mock
|
||||
|
||||
@ -28,11 +27,11 @@ class TestIntegrationImages(TestCase):
|
||||
{'XDG_DATA_HOME': cls.work_dir.as_posix()}
|
||||
))
|
||||
|
||||
cloud_build = CB(SimpleNamespace(
|
||||
cloud_build = CB(
|
||||
config='tests/test_integration_images.yaml',
|
||||
no_tests=True,
|
||||
create_remote_dirs=True,
|
||||
))
|
||||
)
|
||||
cloud_build.create_images()
|
||||
cloud_build.copy_external_files()
|
||||
cloud_build.sign()
|
||||
|
Loading…
Reference in New Issue
Block a user