diff options
author | Endi S. Dewata <edewata@redhat.com> | 2013-08-15 17:15:24 -0400 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2013-08-16 12:10:38 -0400 |
commit | 0b8e4d2262f1b5a8956b5b3ef000981156785bd4 (patch) | |
tree | aff735719637a57eefbf537ccc9e118663228aec /base/server/sbin | |
parent | 17d6be4d85741bffa21d93aceaff00223bc77dec (diff) | |
download | pki-0b8e4d2262f1b5a8956b5b3ef000981156785bd4.tar.gz pki-0b8e4d2262f1b5a8956b5b3ef000981156785bd4.tar.xz pki-0b8e4d2262f1b5a8956b5b3ef000981156785bd4.zip |
Fixed pylint false positive.
Under some circumstances build would fail due to pylint E1103 error
saying "Instance of 'list' has no 'strip' member". This is a false
positive since the object is actually a string. To avoid the error
the code has been changed to explicitly convert the value to string.
Diffstat (limited to 'base/server/sbin')
-rwxr-xr-x | base/server/sbin/pkidestroy | 5 | ||||
-rwxr-xr-x | base/server/sbin/pkispawn | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/base/server/sbin/pkidestroy b/base/server/sbin/pkidestroy index e61b3fabe..79b1c229f 100755 --- a/base/server/sbin/pkidestroy +++ b/base/server/sbin/pkidestroy @@ -86,9 +86,10 @@ def main(argv): # Retrieve DNS domainname config.pki_dns_domainname = None try: - config.pki_dns_domainname = subprocess.check_output("dnsdomainname", + dnsdomainname = subprocess.check_output("dnsdomainname", shell=True) - config.pki_dns_domainname = config.pki_dns_domainname.rstrip('\n') + # workaround for pylint error E1103 + config.pki_dns_domainname = str(dnsdomainname).rstrip('\n') if not len(config.pki_dns_domainname): print log.PKI_DNS_DOMAIN_NOT_SET sys.exit(1) diff --git a/base/server/sbin/pkispawn b/base/server/sbin/pkispawn index 30bb5ce28..988dd6080 100755 --- a/base/server/sbin/pkispawn +++ b/base/server/sbin/pkispawn @@ -88,9 +88,10 @@ def main(argv): # Retrieve DNS domainname try: - config.pki_dns_domainname = subprocess.check_output("dnsdomainname", + dnsdomainname = subprocess.check_output("dnsdomainname", shell = True) - config.pki_dns_domainname = config.pki_dns_domainname.rstrip('\n') + # workaround for pylint error E1103 + config.pki_dns_domainname = str(dnsdomainname).rstrip('\n') if not len(config.pki_dns_domainname): print log.PKI_DNS_DOMAIN_NOT_SET sys.exit(1) |