-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
small code improvements based on sonar cloud warnings
- Loading branch information
Josephine.Rutten
committed
Nov 8, 2024
1 parent
2a806ed
commit 7c101c2
Showing
6 changed files
with
10 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,7 +36,7 @@ def new_managed_device(self, hostname, device_type, serial_number, vendor, model | |
|
||
data: dict[str, dict[str, Any]] = {"node": {"operational_state": "In service"}} | ||
|
||
res = requests.get(str(self.urlbase), headers=headers, verify=False) | ||
res = requests.get(self.urlbase, headers=headers, verify=False) # type: ignore | ||
Check failure Code scanning / SonarCloud Server certificates should be verified during SSL/TLS connections High
Enable server certificate validation on this SSL/TLS connection. See more on SonarCloud
|
||
if not res.status_code == 200: | ||
logger.warn("Failed to fetch devices from NI: {}: {} ({})".format(res.status_code, res.text, data)) | ||
|
||
|
@@ -55,7 +55,7 @@ def new_managed_device(self, hostname, device_type, serial_number, vendor, model | |
data["node"]["ip_addresses"] = [management_ip] | ||
|
||
handle_id = device["handle_id"] | ||
res = requests.put(str(self.urlbase) + str(handle_id) + "/", headers=headers, json=data, verify=False) | ||
res = requests.put(self.urlbase + str(handle_id) + "/", headers=headers, json=data, verify=False) # type: ignore | ||
Check failure Code scanning / SonarCloud Server certificates should be verified during SSL/TLS connections High
Enable server certificate validation on this SSL/TLS connection. See more on SonarCloud
|
||
|
||
if res.status_code != 204: | ||
logger.warn("Could not change device {} with ID {}.".format(hostname, handle_id)) | ||
|