Skip to content

Commit fb9fe14

Browse files
committed
ASC-1559 Fix Version File Lookup
Turns out that the CI scripts will lay down a copy of '/etc/openstack-release' if it doesn't exist somewhere in the post process. However, it already exists then it assumes that the file is readable. Adding the '[default]' INI section to the file makes it fail to import which in turn causes the post script to fail with the result of no qTest results being published. So, the modified file is now being appended with the extension of '.ini' to differentiate it from the original file.
1 parent bc209fb commit fb9fe14

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pytest_rpc/fixtures.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ def openstack_properties():
6969
'private_key_path': '/root/.ssh/rpc_support',
7070
'security_group': 'rpc-support',
7171
'os_version_file_path': '/etc/openstack-release',
72-
'os_version': "99.99.99", # Indicates that the version is unset.
72+
'os_version_ini_path': '/etc/openstack-release.ini',
73+
'os_version': '99.99.99', # Indicates that the version is unset.
7374
'os_version_major': 99,
7475
'os_version_minor': 99,
7576
'os_version_patch': 99,
@@ -78,15 +79,15 @@ def openstack_properties():
7879

7980
# Retrieve OpenStack version information
8081
try:
81-
os_version_file = ConfigParser()
82-
os_version_file.read(unicode(os_properties['os_version_file_path']))
82+
os_version_ini = ConfigParser()
83+
os_version_ini.read(unicode(os_properties['os_version_ini_path']))
8384

8485
# Extract OpenStack version semantics
8586
os_properties['os_version_codename'] = \
86-
os_version_file.get('default', 'DISTRIB_CODENAME').replace('"', '')
87+
os_version_ini.get('default', 'DISTRIB_CODENAME').replace('"', '')
8788
os_properties['os_version'] = \
88-
os_version_file.get('default',
89-
'DISTRIB_RELEASE').replace('"', '').lstrip('r')
89+
os_version_ini.get('default',
90+
'DISTRIB_RELEASE').replace('"', '').lstrip('r')
9091
os_properties['os_version_major'] = \
9192
int(semantic_regex.match(os_properties['os_version']).group(1))
9293
os_properties['os_version_minor'] = \

0 commit comments

Comments
 (0)