diff options
author | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2011-06-01 04:08:01 +0000 |
---|---|---|
committer | lmr <lmr@592f7852-d20e-0410-864c-8624ca9c26a4> | 2011-06-01 04:08:01 +0000 |
commit | b4b99cb059d23aa886d152a063e20043241d011d (patch) | |
tree | 230bf3e4994404097a861a9580e078524efa399f /client | |
parent | 0124b3cf0a8d1089be4416ef151f2d68b426f2f3 (diff) |
KojiClient: only validate tag or build if they're actually set
KojiClient is responsible for getting information and files on
koji/brew. The is_pkg_valid() method was checking for valid tags
and valid builds even when they were not set. Of couse, if neither
are set, the package specification is not valid.
Signed-off-by: Cleber Rosa <crosa@redhat.com>
git-svn-id: svn://test.kernel.org/autotest/trunk@5385 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'client')
-rw-r--r-- | client/virt/virt_utils.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/client/virt/virt_utils.py b/client/virt/virt_utils.py index 5510c899..0f02f3d8 100644 --- a/client/virt/virt_utils.py +++ b/client/virt/virt_utils.py @@ -1796,9 +1796,13 @@ class KojiClient(object): @returns: True or False ''' valid = True - if not self.is_pkg_spec_build_valid(pkg): - valid = False - if not self.is_pkg_spec_tag_valid(pkg): + if pkg.build: + if not self.is_pkg_spec_build_valid(pkg): + valid = False + elif pkg.tag: + if not self.is_pkg_spec_tag_valid(pkg): + valid = False + else: valid = False return valid |