Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
2aca69e3
Commit
2aca69e3
authored
Jan 13, 2021
by
Lorenz Hüdepohl
Browse files
Ignore old/obsolete attribute values in packages
parent
1a91e33a
Changes
1
Hide whitespace changes
Inline
Side-by-side
mpcdf_common.py
View file @
2aca69e3
...
...
@@ -924,6 +924,10 @@ def sync_projects(api_url, package=None, from_project="software", to_projects=No
to_projects
=
[
p
for
p
in
osc
.
core
.
meta_get_project_list
(
api_url
)
if
p
.
startswith
(
"software:"
)
and
not
(
p
==
"software:dist"
or
p
==
"software:images"
)]
allowed_attribute_values
=
{}
for
attribute
in
package_attributes
+
config_attributes
:
allowed_attribute_values
[
attribute
]
=
set
(
get_allowed_attribute_values
(
api_url
,
attribute
))
for
to_project
in
to_projects
:
print
(
"Syncing {0} with {1}"
.
format
(
to_project
,
from_project
))
...
...
@@ -955,12 +959,13 @@ def sync_projects(api_url, package=None, from_project="software", to_projects=No
for
attribute
in
package_attributes
+
config_attributes
:
try
:
attr
=
get_attribute
(
api_url
,
from_project
,
orig_package
,
attribute
)
values
=
list
(
filter
(
lambda
q
:
q
in
allowed_attribute_values
[
attribute
],
get_attribute_values
(
api_url
,
from_project
,
orig_package
,
attribute
)))
except
UnsetAttributeException
:
if
has_attribute
(
api_url
,
to_project
,
orig_package
,
attribute
):
remove_attribute
(
api_url
,
to_project
,
orig_package
,
attribute
)
continue
set_attribute
(
api_url
,
to_project
,
orig_package
,
attr
)
set_attribute
_values
(
api_url
,
to_project
,
orig_package
,
attr
ibute
,
values
)
if
add_to_maintainers
:
from_maintainers
=
maintainers
(
api_url
,
from_project
,
orig_package
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment