Merge pull request #98 from openSUSE/coolo_1795
random fixes related to 1795
This commit is contained in:
commit
6449484202
@ -16,18 +16,15 @@ class ListCommand:
|
||||
for prj in self.api.get_staging_projects():
|
||||
meta = self.api.get_prj_pseudometa(prj)
|
||||
for req in meta['requests']:
|
||||
self.packages_staged[req['package']] = (prj[-1], req['id'])
|
||||
self.packages_staged[req['package']] = {'prj': prj, 'rq_id': req['id'] }
|
||||
|
||||
where = "@by_group='factory-staging'+and+@state='new'"
|
||||
|
||||
url = makeurl(self.api.apiurl, ['search','request'], "match=state/@name='review'+and+review["+where+"]")
|
||||
f = http_GET(url)
|
||||
root = ET.parse(f).getroot()
|
||||
self.supersedes = dict()
|
||||
for rq in root.findall('request'):
|
||||
self.one_request(rq)
|
||||
for letter, reqs in self.supersedes.items():
|
||||
print("osc staging select {} {}".format(letter, ' '.join(reqs)))
|
||||
|
||||
def one_request(self, request):
|
||||
"""
|
||||
|
@ -93,17 +93,24 @@ class RequestFinder:
|
||||
for sr in root.findall('request'):
|
||||
# TODO: check the package matches - OBS is case insensitive
|
||||
request = int(sr.get('id'))
|
||||
self.srs[request] = {'project': 'openSUSE:Factory'}
|
||||
state = sr.find('state').get('name')
|
||||
|
||||
self.srs[request] = {'project': 'openSUSE:Factory', 'state': state }
|
||||
|
||||
review = self._new_review_by_project(request, sr)
|
||||
if review:
|
||||
self.srs[int(request)]['staging'] = review
|
||||
|
||||
if ret:
|
||||
msg = 'There are multiple requests for package "{}": {}'
|
||||
msg = msg.format(package, ', '.join(map(str, self.srs.keys())))
|
||||
if self.srs[ret]['state'] == 'declined':
|
||||
# ignore previous requests if they are declined
|
||||
# if they are the last one, it's fine to return them
|
||||
del self.srs[ret]
|
||||
else:
|
||||
msg = 'There are multiple requests for package "{}": {} and {}'
|
||||
msg = msg.format(package, ret, request)
|
||||
raise oscerr.WrongArgs(msg)
|
||||
ret = True
|
||||
ret = request
|
||||
|
||||
return ret
|
||||
|
||||
|
@ -26,6 +26,8 @@ class SelectCommand(object):
|
||||
package = self._package(request)
|
||||
|
||||
for staging in self.api.get_staging_projects():
|
||||
if staging == self.tprj: # requests for the same project are fine
|
||||
continue
|
||||
for rq in self.api.get_prj_pseudometa(staging)['requests']:
|
||||
if rq['id'] != request and rq['package'] == package:
|
||||
return (rq['id'], package, staging)
|
||||
@ -50,13 +52,13 @@ class SelectCommand(object):
|
||||
return self.api.move_between_project(fprj, rq, self.tprj)
|
||||
elif 'staging' in rq_prj and not move:
|
||||
# Previously selected, but not explicit move
|
||||
msg = 'Request {} is actually in "{}".\n'
|
||||
msg = 'Request {} is already tracked in "{}".'
|
||||
msg = msg.format(rq, rq_prj['staging'])
|
||||
if rq_prj['staging'] != self.tprj:
|
||||
msg += 'Use --move modifier to move the request from "{}" to "{}"'
|
||||
msg += '\nUse --move modifier to move the request from "{}" to "{}"'
|
||||
msg = msg.format(rq_prj['staging'], self.tprj)
|
||||
print(msg)
|
||||
return False
|
||||
return True
|
||||
else:
|
||||
raise oscerr.WrongArgs('Arguments for select are not correct.')
|
||||
|
||||
|
72
tests/fixtures/systemd-search-results.xml
vendored
Normal file
72
tests/fixtures/systemd-search-results.xml
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
<collection matches="1">
|
||||
<request id="123">
|
||||
<action type="submit">
|
||||
<source project="Base:System" package="systemd" rev="536"/>
|
||||
<target project="openSUSE:Factory" package="systemd"/>
|
||||
</action>
|
||||
<state name="review" who="coolo" when="2014-03-05T15:37:34">
|
||||
<comment>Being evaluated by staging project "openSUSE:Factory:Staging:D"</comment>
|
||||
</state>
|
||||
<review state="accepted" when="2014-03-04T10:58:36" who="factory-auto" by_group="factory-auto">
|
||||
<comment>Check script succeeded</comment>
|
||||
</review>
|
||||
<review state="accepted" when="2014-03-04T11:03:42" who="dimstar" by_group="opensuse-review-team">
|
||||
<comment>ok</comment>
|
||||
</review>
|
||||
<review state="accepted" when="2014-03-04T11:03:43" who="factory-repo-checker" by_user="factory-repo-checker">
|
||||
<comment>Builds for repo openSUSE_Factory</comment>
|
||||
</review>
|
||||
<review state="accepted" when="2014-03-04T11:03:43" who="scarabeus_iv" by_group="factory-staging">
|
||||
<comment/>
|
||||
</review>
|
||||
<review state="accepted" when="2014-03-04T11:27:50" who="coolo" by_project="openSUSE:Factory:Staging:B">
|
||||
<comment/>
|
||||
</review>
|
||||
<review state="new" by_project="openSUSE:Factory:Staging:D">
|
||||
<comment>Being evaluated by staging project "openSUSE:Factory:Staging:D"</comment>
|
||||
</review>
|
||||
<history name="review" who="WernerFink" when="2014-03-04T10:58:36"/>
|
||||
<history name="review" who="factory-auto" when="2014-03-04T11:03:42">
|
||||
<comment>Please review sources</comment>
|
||||
</history>
|
||||
<history name="review" who="factory-auto" when="2014-03-04T11:03:43">
|
||||
<comment>Please review build success</comment>
|
||||
</history>
|
||||
<history name="review" who="factory-auto" when="2014-03-04T11:03:43">
|
||||
<comment>Pick Staging Project</comment>
|
||||
</history>
|
||||
<history name="review" who="scarabeus_iv" when="2014-03-04T11:27:50">
|
||||
<comment>Being evaluated by staging project "openSUSE:Factory:Staging:B"</comment>
|
||||
</history>
|
||||
<description>- Make patch 1006-udev-always-rename-network.patch work again
|
||||
and add it again.
|
||||
|
||||
- address missing owner functionality in systemd-tmpfiles (fate#314974)
|
||||
1022-systemd-tmpfiles-ownerkeep.patch
|
||||
|
||||
- Generate the bash completion files on the fly for th ecase of
|
||||
not having the package bash-completion around
|
||||
|
||||
- Update to Release v210
|
||||
+ systemd will now relabel /dev after loading the SMACK policy
|
||||
according to SMACK rules.
|
||||
+ A new unit file option AppArmoreProfile= has been added to
|
||||
set the AppArmor profile for the processes of a unit.
|
||||
+ A new condition check ConditionArchitecture= has been added
|
||||
to conditionalize units based on the system architecture, as
|
||||
reported by uname()'s "machine" field.
|
||||
+ systemd-networkd now supports matching on the system
|
||||
virtualization, architecture, kernel command line, host name
|
||||
and machine ID.
|
||||
+ logind is now a lot more aggressive when suspending the
|
||||
machine due to a closed laptop lid.
|
||||
+ logind will now watch SW_DOCK switches and inhibit reaction
|
||||
to the lid switch if it is pressed.
|
||||
+ nspawn will now make use of the devices cgroup controller by
|
||||
default, and only permit creation of and access to the usual
|
||||
API device nodes like /dev/null or /dev/random, as well as
|
||||
access to (but not creation of) the pty devices.
|
||||
+ systemd will now understand the usual M, K, G, T suffixes
|
||||
according to SI conventions (i.e. to the base 1000) when</description>
|
||||
</request>
|
||||
</collection>
|
@ -46,6 +46,6 @@ class TestSelect(unittest.TestCase):
|
||||
self.obs.register_obs()
|
||||
# make sure the project is frozen recently for other tests
|
||||
|
||||
self.obs.responses['GET']['/request'] = '<collection matches="1"><request id="123"></request></collection>'
|
||||
self.obs.responses['GET']['/request'] = 'systemd-search-results.xml'
|
||||
ret = SelectCommand(self.obs.api).perform('openSUSE:Factory:Staging:B', ['bash'])
|
||||
self.assertEqual(True, ret)
|
||||
|
Loading…
x
Reference in New Issue
Block a user