Merge pull request #133 from openSUSE/wait_for_finished
only wait for finished not for succeeded to build disable bootstrap-copy
This commit is contained in:
commit
c6568094ad
@ -88,16 +88,13 @@ class FreezeCommand(object):
|
|||||||
pass
|
pass
|
||||||
http_PUT(url, data=ET.tostring(pkgmeta))
|
http_PUT(url, data=ET.tostring(pkgmeta))
|
||||||
|
|
||||||
def verify_bootstrap_copy_code(self, code):
|
def verify_bootstrap_copy_codes(self, codes):
|
||||||
url = self.api.makeurl(['build', self.prj, '_result'], { 'package': 'bootstrap-copy' })
|
url = self.api.makeurl(['build', self.prj, '_result'], { 'package': 'bootstrap-copy' })
|
||||||
|
|
||||||
root = ET.parse(http_GET(url)).getroot()
|
root = ET.parse(http_GET(url)).getroot()
|
||||||
for result in root.findall('result'):
|
for result in root.findall('result'):
|
||||||
if result.get('repository') == 'bootstrap_copy':
|
if result.get('repository') == 'bootstrap_copy':
|
||||||
if not result.get('code') in ['published', 'unpublished']:
|
if not result.find('status').get('code') in codes:
|
||||||
return False
|
|
||||||
|
|
||||||
if result.find('status').get('code') != code:
|
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -110,11 +107,11 @@ class FreezeCommand(object):
|
|||||||
self.set_bootstrap_copy()
|
self.set_bootstrap_copy()
|
||||||
self.create_bootstrap_aggregate()
|
self.create_bootstrap_aggregate()
|
||||||
print("waiting for scheduler to disable...")
|
print("waiting for scheduler to disable...")
|
||||||
while not self.verify_bootstrap_copy_code('disabled'):
|
while not self.verify_bootstrap_copy_codes(['disabled']):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self.build_switch_bootstrap_copy('enable')
|
self.build_switch_bootstrap_copy('enable')
|
||||||
print("waiting for scheduler to copy...")
|
print("waiting for scheduler to copy...")
|
||||||
while not self.verify_bootstrap_copy_code('succeeded'):
|
while not self.verify_bootstrap_copy_codes(['finished', 'succeeded']):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
self.build_switch_bootstrap_copy('disable')
|
self.build_switch_bootstrap_copy('disable')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user