This is an automated email from the ASF dual-hosted git repository. gabriel pushed a commit to branch python3-vr in repository https://gitbox.apache.org/repos/asf/cloudstack.git
commit e3c8b34954fa52ef878e3001aa0a6eb9cec3737a Author: Daan Hoogland <d...@onecht.net> AuthorDate: Thu Feb 25 15:04:15 2021 +0100 pylint issues --- systemvm/debian/opt/cloud/bin/baremetal-vr.py | 8 ++++---- systemvm/debian/opt/cloud/bin/cs_ip.py | 2 +- systemvm/debian/opt/cloud/bin/filesystem_writable_check.py | 6 +++--- systemvm/debian/opt/cloud/bin/merge.py | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/systemvm/debian/opt/cloud/bin/baremetal-vr.py b/systemvm/debian/opt/cloud/bin/baremetal-vr.py index 1547d82..4bb3d2b 100755 --- a/systemvm/debian/opt/cloud/bin/baremetal-vr.py +++ b/systemvm/debian/opt/cloud/bin/baremetal-vr.py @@ -16,7 +16,7 @@ #under the License. import subprocess -import urllib +import urllib.request, urllib.parse, urllib.error import hmac import hashlib import base64 @@ -131,10 +131,10 @@ class Server(object): "mac": mac } - request = zip(reqs.keys(), reqs.values()) + request = list(zip(list(reqs.keys()), list(reqs.values()))) request.sort(key=lambda x: str.lower(x[0])) - hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20").replace('=', '%3d')]) for r in request]) - sig = urllib.quote_plus(base64.encodestring(hmac.new(secretkey, hashStr, hashlib.sha1).digest()).strip()) + hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.parse.quote_plus(str(r[1]))).replace("+", "%20").replace('=', '%3d')]) for r in request]) + sig = urllib.parse.quote_plus(base64.encodebytes(hmac.new(secretkey, hashStr, hashlib.sha1).digest()).strip()) return sig def notify_provisioning_done(self, mac): diff --git a/systemvm/debian/opt/cloud/bin/cs_ip.py b/systemvm/debian/opt/cloud/bin/cs_ip.py index fe78c03..5a9f275 100755 --- a/systemvm/debian/opt/cloud/bin/cs_ip.py +++ b/systemvm/debian/opt/cloud/bin/cs_ip.py @@ -54,7 +54,7 @@ def merge(dbag, ip): ip['broadcast'] = str(ipo.broadcast_address) ip['cidr'] = str(ipo.network_address) + '/' + str(ipo.prefixlen) ip['size'] = str(ipo.prefixlen) - ip['network'] = str(ipo.ip_network) + ip['network'] = str(ipo.compressed) if 'nw_type' not in list(ip.keys()): ip['nw_type'] = 'public' else: diff --git a/systemvm/debian/opt/cloud/bin/filesystem_writable_check.py b/systemvm/debian/opt/cloud/bin/filesystem_writable_check.py index eac7d9c..4b2e2cb 100644 --- a/systemvm/debian/opt/cloud/bin/filesystem_writable_check.py +++ b/systemvm/debian/opt/cloud/bin/filesystem_writable_check.py @@ -28,17 +28,17 @@ def check_filesystem(): readOnly1 = bool(stat1.f_flag & ST_RDONLY) if (readOnly1): - print "Read-only file system : monitor results (/root) file system is mounted as read-only" + print("Read-only file system : monitor results (/root) file system is mounted as read-only") exit(1) stat2 = os.statvfs('/var/cache/cloud') readOnly2 = bool(stat2.f_flag & ST_RDONLY) if (readOnly2): - print "Read-only file system : config info (/var/cache/cloud) file system is mounted as read-only" + print("Read-only file system : config info (/var/cache/cloud) file system is mounted as read-only") exit(1) - print "file system is writable" + print("file system is writable") exit(0) diff --git a/systemvm/debian/opt/cloud/bin/merge.py b/systemvm/debian/opt/cloud/bin/merge.py index 607dca7..60318e5 100755 --- a/systemvm/debian/opt/cloud/bin/merge.py +++ b/systemvm/debian/opt/cloud/bin/merge.py @@ -97,7 +97,7 @@ class updateDataBag: self.db.setKey("forwardingrules") else: self.db.setKey(self.qFile.type) - dbag = self.db.load() + self.db.load() logging.info("Command of type %s received", self.qFile.type) if self.qFile.type == 'ips':