import os import sys #from do_json import * import do_json import hyp_utils import constants import ipaddress import raas_utils """@params: param1 = vpc config file (required) """ if __name__=="__main__": if (len(sys.argv) < 2): raas_utils.log_client("VPC config not provided") raas_utils.log_service("Please give vpc config file") exit(1) spine_config_file = sys.argv[1] spine_name = spine_config_file.split('/')[-1].split('.')[0] #Assumed customer always gives correct config file spine_data = do_json.json_read(spine_config_file) hypervisor = spine_data["hypervisor_name"] hypervisor_arg = "hypervisor="+hypervisor hypervisors_data = hyp_utils.get_hypervisors_data()
import sys import do_json import raas_utils import hyp_utils import constants import ipaddress #import logging #from logging import info as raas_utils.log_service #logging.basicConfig(filename='raas.log', filemode='a', format='%(asctime)s %(name)s - %(levelname)s - %(message)s', level=logging.INFO) """@params: param1 = vpc config file (required) """ if __name__=="__main__": if (len(sys.argv) < 2): raas_utils.log_client("Config not provided.........aborting") raas_utils.log_service("Please give vpc config file") exit(1) pc_config_file = sys.argv[1] pc_name = pc_config_file.split('/')[-1].split('.')[0] #Assumed customer always gives correct config file pc_data = do_json.json_read(pc_config_file) hypervisor = pc_data["hypervisor_name"] hypervisor_arg = "hypervisor="+hypervisor hypervisors_data = hyp_utils.get_hypervisors_data()
import do_json import raas_utils import hyp_utils import constants import ipaddress #import logging #from logging import info as raas_utils.log_service #logging.basicConfig(filename='raas.log', filemode='a', format='%(asctime)s %(name)s - %(levelname)s - %(message)s', level=logging.INFO) """@params: param1 = l1_transit config file (required) """ if __name__=="__main__": if (len(sys.argv) < 2): raas_utils.log_client("Please give l1_transit config file.....aborting") raas_utils.log_service("Please give l1_transit config file......aborting") exit(1) l1_transit_config_file = sys.argv[1] l1_transit_name = l1_transit_config_file.split('/')[-1].split('.')[0] #Assumed customer always gives correct config file l1_transit_data = do_json.json_read(l1_transit_config_file) hypervisor = l1_transit_data["hypervisor_name"] hypervisor_arg = "hypervisor="+hypervisor hypervisors_data = hyp_utils.get_hypervisors_data()
import os import sys import do_json import raas_utils import constants import ipaddress import hyp_utils from subprocess import Popen, PIPE """@params: param1 = vpc config file (required) """ if __name__ == "__main__": if (len(sys.argv) < 2): raas_utils.log_service("Please give vpc config file") raas_utils.log_client("No config file present") exit(1) vpc_config_file = sys.argv[1] vpc_name = vpc_config_file.split('/')[-1].split('.')[0] if raas_utils.client_exists_vpc(vpc_name): raas_utils.log_client("Vpc already exists") raas_utils.log_client("aborting vpc creation") raas_utils.log_service("Vpc already exists") raas_utils.log_service("aborting vpc creation") exit(1) #Assumed customer always gives correct config file vpc_config_data = do_json.json_read(vpc_config_file)
import do_json import raas_utils import hyp_utils import constants import ipaddress #import logging #from logging import info as raas_utils.log_service #logging.basicConfig(filename='raas.log', filemode='a', format='%(asctime)s %(name)s - %(levelname)s - %(message)s', level=logging.INFO) """@params: param1 = l2_transit config file (required) """ if __name__ == "__main__": if (len(sys.argv) < 2): raas_utils.log_service("Please give l2_transit config file") raas_utils.log_client("Please give l2_transit config file") exit(1) l2_transit_config_file = sys.argv[1] l2_transit_name = l2_transit_config_file.split('/')[-1].split('.')[0] #Assumed customer always gives correct config file l2_transit_data = do_json.json_read(l2_transit_config_file) hypervisor = l2_transit_data["hypervisor_name"] hypervisor_arg = "hypervisor=" + hypervisor hypervisors_data = hyp_utils.get_hypervisors_data() hypervisor_ip = hyp_utils.get_hyp_ip(hypervisor)
import do_json import raas_utils import hyp_utils import constants import ipaddress #import logging #from logging import info as raas_utils.log_service #logging.basicConfig(filename='raas.log', filemode='a', format='%(asctime)s %(name)s - %(levelname)s - %(message)s', level=logging.INFO) """@params: param1 = leaf config file (required) """ if __name__=="__main__": if (len(sys.argv) < 3): raas_utils.log_client("Config file missing.......aborting") raas_utils.log_service("Please give leaf config file......asborting") exit(1) leaf_config_file = sys.argv[1] #dhcp leaf or dummy leaf dhcp_flag = sys.argv[2] if (dhcp_flag == "true" or dhcp_flag == "True"): dhcp_flag = True else: dhcp_flag = False leaf_name = leaf_config_file.split('/')[-1].split('.')[0] #Assumed customer always gives correct config file