Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit 3129204

Browse files
authored
Fix issues reported in Python scripts (#879)
1 parent f4bdb68 commit 3129204

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

Providers/Scripts/protocol.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def write_values(fd, d):
169169
trace('</write_values>')
170170

171171

172-
class file_desc:
172+
class File_desc:
173173
def sendall(self, buf):
174174
pass
175175

Providers/Scripts/zipfile2.6.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def __init__(self, filename="NoName", date_time=(1980,1,1,0,0,0)):
294294
# compress_size Size of the compressed file
295295
# file_size Size of the uncompressed file
296296

297-
def FileHeader(self):
297+
def fileHeader(self):
298298
"""Return the per-file header as a string."""
299299
dt = self.date_time
300300
dosdate = (dt[0] - 1980) << 9 | dt[1] << 5 | dt[2]
@@ -1036,15 +1036,15 @@ def write(self, filename, arcname=None, compress_type=None):
10361036
zinfo.CRC = 0
10371037
self.filelist.append(zinfo)
10381038
self.NameToInfo[zinfo.filename] = zinfo
1039-
self.fp.write(zinfo.FileHeader())
1039+
self.fp.write(zinfo.fileHeader())
10401040
return
10411041

10421042
fp = open(filename, "rb")
10431043
# Must overwrite CRC and sizes with correct data later
10441044
zinfo.CRC = CRC = 0
10451045
zinfo.compress_size = compress_size = 0
10461046
zinfo.file_size = file_size = 0
1047-
self.fp.write(zinfo.FileHeader())
1047+
self.fp.write(zinfo.fileHeader())
10481048
if zinfo.compress_type == ZIP_DEFLATED:
10491049
cmpr = zlib.compressobj(zlib.Z_DEFAULT_COMPRESSION,
10501050
zlib.DEFLATED, -15)
@@ -1108,7 +1108,7 @@ def writestr(self, zinfo_or_arcname, bytes):
11081108
else:
11091109
zinfo.compress_size = zinfo.file_size
11101110
zinfo.header_offset = self.fp.tell() # Start of header bytes
1111-
self.fp.write(zinfo.FileHeader())
1111+
self.fp.write(zinfo.fileHeader())
11121112
self.fp.write(bytes)
11131113
self.fp.flush()
11141114
if zinfo.flag_bits & 0x08:

Providers/nxOMSAutomationWorker/automationworker/3.x/scripts/register.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def register_worker(self):
6969

7070
url = "{0}/HybridV2(MachineId='{1}')".format(self.endpoint, self.machine_id)
7171

72-
req = requests.put(url, cert=(self.cert_path, self.cert_key_path), verify=False, headers=header,
72+
req = requests.put(url, cert=(self.cert_path, self.cert_key_path), verify=True, headers=header,
7373
data=json.dumps(payload))
7474

7575
if req.status_code is not 200:
@@ -101,7 +101,7 @@ def deregister_worker(self):
101101

102102
url = "{0}/Hybrid(MachineId='{1}')".format(self.endpoint, self.machine_id)
103103

104-
req = requests.delete(url, cert=(self.cert_path, self.cert_key_path), verify=False, headers=header,
104+
req = requests.delete(url, cert=(self.cert_path, self.cert_key_path), verify=True, headers=header,
105105
data=json.dumps(payload))
106106

107107
if req.status_code is not 200:

Providers/nxOMSAutomationWorker/automationworker/3.x/worker/simplejson/scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ def decorator(fn):
6666
return fn
6767
return decorator
6868

69-
def InsignificantWhitespace(match, context):
69+
def insignificantWhitespace(match, context):
7070
return None, None
71-
pattern(r'\s+')(InsignificantWhitespace)
71+
pattern(r'\s+')(insignificantWhitespace)

Providers/nxOMSAutomationWorker/automationworker/scripts/register.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def register_worker(self):
6969

7070
url = "{0}/HybridV2(MachineId='{1}')".format(self.endpoint, self.machine_id)
7171

72-
req = requests.put(url, cert=(self.cert_path, self.cert_key_path), verify=False, headers=header,
72+
req = requests.put(url, cert=(self.cert_path, self.cert_key_path), verify=True, headers=header,
7373
data=json.dumps(payload))
7474

7575
if req.status_code is not 200:
@@ -101,7 +101,7 @@ def deregister_worker(self):
101101

102102
url = "{0}/Hybrid(MachineId='{1}')".format(self.endpoint, self.machine_id)
103103

104-
req = requests.delete(url, cert=(self.cert_path, self.cert_key_path), verify=False, headers=header,
104+
req = requests.delete(url, cert=(self.cert_path, self.cert_key_path), verify=True, headers=header,
105105
data=json.dumps(payload))
106106

107107
if req.status_code is not 200:

Providers/nxOMSAutomationWorker/automationworker/worker/simplejson/scanner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ def decorator(fn):
6666
return fn
6767
return decorator
6868

69-
def InsignificantWhitespace(match, context):
69+
def insignificantWhitespace(match, context):
7070
return None, None
71-
pattern(r'\s+')(InsignificantWhitespace)
71+
pattern(r'\s+')(insignificantWhitespace)

0 commit comments

Comments
 (0)