Skip to content

Commit 780f8f0

Browse files
authored
Merge pull request xapi-project#251 from huizh/CA-231365
CA-229070: switch to @update group
2 parents 625551c + 3501396 commit 780f8f0

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

scripts/extensions/pool_update.apply

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ if __name__ == '__main__':
8383
sys.exit(0)
8484

8585
update_uuid = session.xenapi.pool_update.get_uuid(update)
86-
update_package = 'update-' + session.xenapi.pool_update.get_name_label(update)
8786
yum_conf_file = os.path.join(TMP_DIR, update_uuid, 'yum.conf')
8887

8988
# To prevent the race condition of invoking apply, set a lock.
@@ -126,7 +125,7 @@ if __name__ == '__main__':
126125
with open (yum_conf_file, "w+") as file:
127126
file.write("{0}".format(yum_conf))
128127

129-
execute_apply(session, update_package, yum_conf_file)
128+
execute_apply(session, '@update', yum_conf_file)
130129

131130
session.xenapi.pool_update.resync_host(host)
132131
print(success_message())

scripts/extensions/pool_update.precheck

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ UPDATE_PRECHECK_FAILED_PREREQUISITE_MISSING = 'UPDATE_PRECHECK_FAILED_PREREQUISI
2525
UPDATE_PRECHECK_FAILED_CONFLICT_PRESENT = 'UPDATE_PRECHECK_FAILED_CONFLICT_PRESENT'
2626
UPDATE_PRECHECK_FAILED_WRONG_SERVER_VERSION = 'UPDATE_PRECHECK_FAILED_WRONG_SERVER_VERSION'
2727
UPDATE_PRECHECK_FAILED_OUT_OF_SPACE = 'UPDATE_PRECHECK_FAILED_OUT_OF_SPACE'
28-
UPDATE_PREFIX = 'update-'
2928
INVALID_UPDATE = 'INVALID_UPDATE'
3029
CANNOT_FIND_UPDATE = 'CANNOT_FIND_UPDATE'
3130
ERROR_MESSAGE_START = 'Error: '
@@ -97,7 +96,7 @@ def execute_precheck(session, control_package, yum_conf_file, update_precheck_fi
9796
errmsg = m.group()
9897
errmsg = re.sub(ERROR_MESSAGE_END + '.+', '', errmsg, flags=re.DOTALL)
9998
if ERROR_MESSAGE_CONFLICTS_WITH in errmsg and ERROR_MESSAGE_PROCESSING_CONFLICT in output:
100-
regex = ERROR_MESSAGE_PROCESSING_CONFLICT + '(.*)' + ERROR_MESSAGE_CONFLICTS + UPDATE_PREFIX + '(.+?)\n'
99+
regex = ERROR_MESSAGE_PROCESSING_CONFLICT + '(.*)' + ERROR_MESSAGE_CONFLICTS + '(.+?)\n'
101100
conflict_tuples = re.findall(regex, output)
102101
if len(conflict_tuples) > 0:
103102
conflict_updates = ''
@@ -116,7 +115,7 @@ def execute_precheck(session, control_package, yum_conf_file, update_precheck_fi
116115
else:
117116
raise PrecheckFailure(errmsg)
118117
elif ERROR_MESSAGE_PREREQUISITE in errmsg:
119-
regex = ERROR_MESSAGE_PREREQUISITE + UPDATE_PREFIX + '(.+?)\n'
118+
regex = ERROR_MESSAGE_PREREQUISITE + '(.+?)\n'
120119
prerequisite_list = re.findall(regex, errmsg)
121120
if len(prerequisite_list) > 0:
122121
prerequisite_updates = ''

0 commit comments

Comments
 (0)