testcloud 0.11.1__tar.gz → 0.11.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {testcloud-0.11.1/testcloud.egg-info → testcloud-0.11.2}/PKG-INFO +1 -1
- {testcloud-0.11.1 → testcloud-0.11.2}/docs/source/conf.py +1 -1
- {testcloud-0.11.1 → testcloud-0.11.2}/test/test_config.py +1 -1
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/__init__.py +1 -1
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/config.py +28 -4
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/instance.py +2 -2
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/sql.py +7 -1
- {testcloud-0.11.1 → testcloud-0.11.2/testcloud.egg-info}/PKG-INFO +1 -1
- {testcloud-0.11.1 → testcloud-0.11.2}/.gitignore +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/LICENSE +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/README.md +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/conf/99-testcloud-nonroot-libvirt-access.rules +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/conf/settings-example.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/conf/testcloud +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/docs/LICENSE +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/docs/Makefile +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/docs/source/api.rst +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/docs/source/indepth.rst +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/docs/source/index.rst +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/manpages/testcloud.1 +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/pyproject.toml +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/requirements.txt +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/run_testcloud.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/setup.cfg +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/setup.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/test/__init__.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/test/test_cli.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/test/test_image.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/test/test_instance.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/cli.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/__init__.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/alma.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/centos.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/debian.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/fedora.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/misc.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/oracle.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/rocky.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/distro_utils/ubuntu.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/domain_configuration.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/exceptions.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/image.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/util.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud/workarounds.py +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud.egg-info/SOURCES.txt +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud.egg-info/dependency_links.txt +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud.egg-info/entry_points.txt +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud.egg-info/requires.txt +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/testcloud.egg-info/top_level.txt +0 -0
- {testcloud-0.11.1 → testcloud-0.11.2}/tox.ini +0 -0
|
@@ -66,7 +66,7 @@ class TestConfig(object):
|
|
|
66
66
|
test_config = config.ConfigData()
|
|
67
67
|
assert test_config.DATA_DIR != REF_DATA_DIR
|
|
68
68
|
|
|
69
|
-
test_config.
|
|
69
|
+
test_config._merge_object(test_config_obj)
|
|
70
70
|
assert test_config.DATA_DIR == REF_DATA_DIR
|
|
71
71
|
|
|
72
72
|
def test_load_merge_config_file(self, tmpdir, monkeypatch):
|
|
@@ -45,7 +45,7 @@ def _parse_config():
|
|
|
45
45
|
|
|
46
46
|
if config_filename is not None:
|
|
47
47
|
loaded_config = _load_config(config_filename)
|
|
48
|
-
config.
|
|
48
|
+
config._merge_object(loaded_config)
|
|
49
49
|
|
|
50
50
|
return config
|
|
51
51
|
|
|
@@ -98,7 +98,20 @@ class ConfigData(object):
|
|
|
98
98
|
|
|
99
99
|
# Directories testcloud cares about
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
__DATA_DIR = "/var/lib/testcloud"
|
|
102
|
+
|
|
103
|
+
@property
|
|
104
|
+
def DATA_DIR(self):
|
|
105
|
+
return self.__DATA_DIR
|
|
106
|
+
|
|
107
|
+
@DATA_DIR.setter
|
|
108
|
+
def DATA_DIR(self, value):
|
|
109
|
+
if self.__DATA_DIR == value:
|
|
110
|
+
return
|
|
111
|
+
from testcloud import sql
|
|
112
|
+
sql.data_dir_changed(value)
|
|
113
|
+
self.__DATA_DIR = value
|
|
114
|
+
|
|
102
115
|
STORE_DIR = "/var/lib/testcloud/backingstores"
|
|
103
116
|
|
|
104
117
|
# Data for cloud-init
|
|
@@ -263,7 +276,7 @@ storage:
|
|
|
263
276
|
UBUNTU_RELEASES_API = "https://api.launchpad.net/devel/ubuntu/series"
|
|
264
277
|
UBUNTU_IMG_URL = "https://cloud-images.ubuntu.com/%s/current/%s-server-cloudimg-%s.img"
|
|
265
278
|
|
|
266
|
-
def
|
|
279
|
+
def _merge_object(self, obj):
|
|
267
280
|
"""Overwrites default values with values from a python object which have
|
|
268
281
|
names containing all upper case letters.
|
|
269
282
|
|
|
@@ -273,4 +286,15 @@ storage:
|
|
|
273
286
|
|
|
274
287
|
for key in dir(obj):
|
|
275
288
|
if key.isupper():
|
|
276
|
-
|
|
289
|
+
if key != "DATA_DIR":
|
|
290
|
+
setattr(self, key, getattr(obj, key))
|
|
291
|
+
else:
|
|
292
|
+
# I hate life... but since we want to "automagically" work around TMT's
|
|
293
|
+
# way of changing the DATA_DIR on the fly, I don't see another way.
|
|
294
|
+
try:
|
|
295
|
+
self.DATA_DIR = getattr(obj, key)
|
|
296
|
+
except AttributeError as e:
|
|
297
|
+
if 'partially initialized module' in str(e):
|
|
298
|
+
self.__DATA_DIR = getattr(obj, key)
|
|
299
|
+
else:
|
|
300
|
+
raise
|
|
@@ -429,9 +429,9 @@ class Instance(object):
|
|
|
429
429
|
key_content = None
|
|
430
430
|
# We need this weird code until the way of objects sharing with tmt gets refactored
|
|
431
431
|
try:
|
|
432
|
-
bu_data =
|
|
432
|
+
bu_data = coreos_data_tpl % key_content
|
|
433
433
|
except TypeError:
|
|
434
|
-
bu_data =
|
|
434
|
+
bu_data = coreos_data_tpl
|
|
435
435
|
with open(self.bu_path, "w") as user_file:
|
|
436
436
|
user_file.write(bu_data)
|
|
437
437
|
|
|
@@ -15,7 +15,7 @@ logger.setLevel(logging.ERROR)
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
cfg = config.get_config()
|
|
18
|
-
if os.path.exists(cfg.DATA_DIR):
|
|
18
|
+
if os.path.exists(cfg.DATA_DIR) and os.access(cfg.DATA_DIR, os.W_OK):
|
|
19
19
|
DB = pw.SqliteDatabase(os.path.join(cfg.DATA_DIR, "testcloud.sqlite"))
|
|
20
20
|
else:
|
|
21
21
|
DB = pw.SqliteDatabase(":memory:")
|
|
@@ -51,5 +51,11 @@ class DBImage(pw.Model):
|
|
|
51
51
|
table_name = "image"
|
|
52
52
|
|
|
53
53
|
|
|
54
|
+
def data_dir_changed(pth):
|
|
55
|
+
global DB
|
|
56
|
+
DB = pw.SqliteDatabase(os.path.join(pth, "testcloud.sqlite"))
|
|
57
|
+
DB.connect()
|
|
58
|
+
DB.create_tables([DBImage])
|
|
59
|
+
|
|
54
60
|
DB.connect()
|
|
55
61
|
DB.create_tables([DBImage])
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|