summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToshio Kuratomi <a.badger@gmail.com>2016-11-17 14:04:22 -0800
committerToshio Kuratomi <a.badger@gmail.com>2016-11-17 14:06:30 -0800
commitf202c8184b8ed4a69a72eb2e623ddb27c8f33973 (patch)
treecc675ec4c76c4953b9567d2fbc068430a34603d2
parent5275b509044a30887d58ff4a70d5c52e3a29ca5c (diff)
downloadansible-modules-core-f202c8184b8ed4a69a72eb2e623ddb27c8f33973.tar.gz
Older versions of rhn-client-tools don't understand containment tests.
(cherry picked from commit d3543ff67c788531cadfcaee19395bbb70125364)
-rw-r--r--packaging/os/rhn_register.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/packaging/os/rhn_register.py b/packaging/os/rhn_register.py
index f5ee2982..2c7461a4 100644
--- a/packaging/os/rhn_register.py
+++ b/packaging/os/rhn_register.py
@@ -147,9 +147,10 @@ class Rhn(RegistrationBase):
# configuration. Yeah, I know this should be subclassed ... but, oh
# well
def get_option_default(self, key, default=''):
- # ignore pep8 W601 errors for this line
- # setting this to use 'in' does not work in the rhn library
- if key in self:
+ # the class in rhn-client-tools that this comes from didn't
+ # implement __contains__(). That's why we check if the key is
+ # present in the dictionary that is the actual storage
+ if key in self.dict:
return self[key]
else:
return default