summaryrefslogtreecommitdiff
path: root/obsapi
diff options
context:
space:
mode:
authorScott Bahling <sbahling@suse.com>2020-01-31 17:54:08 +0100
committerScott Bahling <sbahling@suse.com>2020-01-31 17:54:08 +0100
commit8e104aebe3a67bb0c4f8f5f4a7c901c3eb79332f (patch)
tree3bdeac9fcce80fd0822bd9c98af8d0e29777aee9 /obsapi
parent67645bbd2ee5efac39f47a52ac60b049aecb09bd (diff)
downloadobsapi-8e104aebe3a67bb0c4f8f5f4a7c901c3eb79332f.tar.gz
obsapi-8e104aebe3a67bb0c4f8f5f4a7c901c3eb79332f.tar.xz
obsapi-8e104aebe3a67bb0c4f8f5f4a7c901c3eb79332f.zip
Fix repoflags
Diffstat (limited to 'obsapi')
-rw-r--r--obsapi/repoflags.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/obsapi/repoflags.py b/obsapi/repoflags.py
index 062f0e3..61ddbbe 100644
--- a/obsapi/repoflags.py
+++ b/obsapi/repoflags.py
@@ -54,10 +54,14 @@ class RepoFlags():
self.root = element
return
- # If flag_type is not set, set it to the root element tag
- flag_type = self.root.tag
- if flag_type in valid_flag_types:
+ # element matching flag_type not found in xml, create new element
+ self.root = etree.Element(self.flag_type)
return
+ else:
+ # If flag_type is not set, set it to the root element tag
+ flag_type = self.root.tag
+ if flag_type in valid_flag_types:
+ return
# if root element is not a valid repo flag type, search for the
# first element that is a valid flag type and use it.