Merge pull request #2530 from nilxam/no_date_product_version_leap
accept_command: use the value of attribute to set ProductVersion if always_set_productversion_to option presents
This commit is contained in:
commit
b376746fd8
@ -10,6 +10,7 @@ from osc.core import change_request_state, show_package_meta, wipebinaries
|
|||||||
from osc.core import http_GET, http_PUT, http_DELETE, http_POST
|
from osc.core import http_GET, http_PUT, http_DELETE, http_POST
|
||||||
from osc.core import delete_package, search, meta_get_packagelist
|
from osc.core import delete_package, search, meta_get_packagelist
|
||||||
from osc.core import Request
|
from osc.core import Request
|
||||||
|
from osc import conf
|
||||||
from osc.util.helper import decode_it
|
from osc.util.helper import decode_it
|
||||||
from osclib.core import attribute_value_save
|
from osclib.core import attribute_value_save
|
||||||
from osclib.core import attribute_value_load
|
from osclib.core import attribute_value_load
|
||||||
@ -22,6 +23,7 @@ from datetime import date
|
|||||||
class AcceptCommand(object):
|
class AcceptCommand(object):
|
||||||
def __init__(self, api):
|
def __init__(self, api):
|
||||||
self.api = api
|
self.api = api
|
||||||
|
self.config = conf.config[self.api.project]
|
||||||
|
|
||||||
def find_new_requests(self, project):
|
def find_new_requests(self, project):
|
||||||
match = f"state/@name='new' and action/target/@project='{project}'"
|
match = f"state/@name='new' and action/target/@project='{project}'"
|
||||||
@ -239,7 +241,11 @@ class AcceptCommand(object):
|
|||||||
# missleading.
|
# missleading.
|
||||||
|
|
||||||
project = self.api.project
|
project = self.api.project
|
||||||
curr_version = date.today().strftime('%Y%m%d')
|
pred_productversion = self.config.get('always_set_productversion_to', '')
|
||||||
|
if pred_productversion:
|
||||||
|
curr_version = pred_productversion
|
||||||
|
else:
|
||||||
|
curr_version = date.today().strftime('%Y%m%d')
|
||||||
|
|
||||||
self.update_version_attribute(project, curr_version)
|
self.update_version_attribute(project, curr_version)
|
||||||
|
|
||||||
|
@ -46,6 +46,7 @@ DEFAULT = {
|
|||||||
'mail-maintainer': 'Dominique Leuenberger <dimstar@suse.de>',
|
'mail-maintainer': 'Dominique Leuenberger <dimstar@suse.de>',
|
||||||
'mail-noreply': 'noreply@opensuse.org',
|
'mail-noreply': 'noreply@opensuse.org',
|
||||||
'mail-release-list': 'opensuse-releaseteam@opensuse.org',
|
'mail-release-list': 'opensuse-releaseteam@opensuse.org',
|
||||||
|
'always_set_productversion_to': '',
|
||||||
},
|
},
|
||||||
r'openSUSE:(?P<project>Factory):ARM$': {
|
r'openSUSE:(?P<project>Factory):ARM$': {
|
||||||
'product': 'openSUSE.product',
|
'product': 'openSUSE.product',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user