From e85aaf405a0b5ced9e7947982c3918ca5d89911c Mon Sep 17 00:00:00 2001 From: Nick Schmidt Date: Tue, 3 Jan 2023 12:26:28 -0900 Subject: [PATCH] remove ssl/tls nag --- CHANGELOG.md | 6 ++++++ restify/RuminatingCogitation.py | 3 +++ vsphere_rest/deploy_clib_vm.py | 4 ++++ 3 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d4018c..35c0eed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [03-Jan-2023] v0.2.8 + +### Changed + +- Removed Nag for SSL/TLS validation warnings if validation is disabled + ## [02-Jan-2023] v0.2.7 ### Changed diff --git a/restify/RuminatingCogitation.py b/restify/RuminatingCogitation.py index 301239d..c181ec1 100644 --- a/restify/RuminatingCogitation.py +++ b/restify/RuminatingCogitation.py @@ -140,6 +140,9 @@ def __init__( self.cogitation_certvalidation = json_settings["settings"]["tls"][ "validation" ] + # Reduce spam by disabling the certificate validation nag spam + if self.cogitation_certvalidation is False: + requests.packages.urllib3.disable_warnings() # Authentication Settings self.cogitation_username = input_user self.cogitation_password = input_pass diff --git a/vsphere_rest/deploy_clib_vm.py b/vsphere_rest/deploy_clib_vm.py index 1640956..c556e10 100644 --- a/vsphere_rest/deploy_clib_vm.py +++ b/vsphere_rest/deploy_clib_vm.py @@ -7,6 +7,7 @@ # System Calls import os import sys +import requests # Arguments Parsing import argparse @@ -71,6 +72,9 @@ json_payload = json.load(json_filehandle) except Exception as e: exit("Error Loading Payload File " + args.p + ": " + str(e)) + for i in ["id", "name", "datastore", "folder", "cluster"]: + if json_payload[i] is False: + exit("Missing Key in payload: " + i) # Get the API key and add it to the API interface object cogitation_interface.add_http_header(