Skip to content

Commit a65de5d

Browse files
author
Daan Hoogland
committed
pylint issues
1 parent 2724395 commit a65de5d

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

systemvm/debian/opt/cloud/bin/baremetal-vr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#under the License.
1717

1818
import subprocess
19-
import urllib
19+
import urllib.request, urllib.parse, urllib.error
2020
import hmac
2121
import hashlib
2222
import base64
@@ -131,10 +131,10 @@ def _make_sign(self, mac):
131131
"mac": mac
132132
}
133133

134-
request = zip(reqs.keys(), reqs.values())
134+
request = list(zip(list(reqs.keys()), list(reqs.values())))
135135
request.sort(key=lambda x: str.lower(x[0]))
136-
hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.quote_plus(str(r[1]))).replace("+", "%20").replace('=', '%3d')]) for r in request])
137-
sig = urllib.quote_plus(base64.encodestring(hmac.new(secretkey, hashStr, hashlib.sha1).digest()).strip())
136+
hashStr = "&".join(["=".join([str.lower(r[0]), str.lower(urllib.parse.quote_plus(str(r[1]))).replace("+", "%20").replace('=', '%3d')]) for r in request])
137+
sig = urllib.parse.quote_plus(base64.encodebytes(hmac.new(secretkey, hashStr, hashlib.sha1).digest()).strip())
138138
return sig
139139

140140
def notify_provisioning_done(self, mac):

systemvm/debian/opt/cloud/bin/cs_ip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def merge(dbag, ip):
5454
ip['broadcast'] = str(ipo.broadcast_address)
5555
ip['cidr'] = str(ipo.network_address) + '/' + str(ipo.prefixlen)
5656
ip['size'] = str(ipo.prefixlen)
57-
ip['network'] = str(ipo.ip_network)
57+
ip['network'] = str(ipo.compressed)
5858
if 'nw_type' not in list(ip.keys()):
5959
ip['nw_type'] = 'public'
6060
else:

systemvm/debian/opt/cloud/bin/filesystem_writable_check.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ def check_filesystem():
2828
readOnly1 = bool(stat1.f_flag & ST_RDONLY)
2929

3030
if (readOnly1):
31-
print "Read-only file system : monitor results (/root) file system is mounted as read-only"
31+
print("Read-only file system : monitor results (/root) file system is mounted as read-only")
3232
exit(1)
3333

3434
stat2 = os.statvfs('/var/cache/cloud')
3535
readOnly2 = bool(stat2.f_flag & ST_RDONLY)
3636

3737
if (readOnly2):
38-
print "Read-only file system : config info (/var/cache/cloud) file system is mounted as read-only"
38+
print("Read-only file system : config info (/var/cache/cloud) file system is mounted as read-only")
3939
exit(1)
4040

41-
print "file system is writable"
41+
print("file system is writable")
4242
exit(0)
4343

4444

systemvm/debian/opt/cloud/bin/merge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def process(self):
9797
self.db.setKey("forwardingrules")
9898
else:
9999
self.db.setKey(self.qFile.type)
100-
dbag = self.db.load()
100+
self.db.load()
101101
logging.info("Command of type %s received", self.qFile.type)
102102

103103
if self.qFile.type == 'ips':

0 commit comments

Comments
 (0)