Beispiel #1
0
formatter = logging.Formatter('%(message)s')
if not logger.handlers:
    timedRotatingFileHandler = logging.handlers.TimedRotatingFileHandler(
        "logs/%s.log" % out_file, when='midnight', interval=1, backupCount=30)
    streamHandler = logging.StreamHandler()
    timedRotatingFileHandler.setFormatter(formatter)
    streamHandler.setFormatter(formatter)
    logger.addHandler(timedRotatingFileHandler)
    logger.addHandler(streamHandler)
    logger.setLevel(logging.INFO)
else:
    pass
#########################logger code end

ssh_obj = ssh_functions()
creation_object = Os_Creation_Modules()
delete_object = Os_Deletion_Modules()

conn_create = creation_object.os_connection_creation()
conn_delete = delete_object.os_connection_creation()


def execute_tcp_dump(session, timeout, namespace_id, interface, find=None):
    global stdout_a
    try:
        #print "\nExecuting tcp dump command to capture PAD packets"
        if find is None:
            stdin_a, stdout_a, stderr_a = session.exec_command(
                "sudo ip netns exec %s timeout %s tcpdump -i %s" %
                (namespace_id, timeout, interface))
        else:
formatter = logging.Formatter('%(message)s')
if not logger.handlers:
    timedRotatingFileHandler = logging.handlers.TimedRotatingFileHandler(
        "logs/%s.log" % out_file, when='midnight', interval=1, backupCount=30)
    streamHandler = logging.StreamHandler()
    timedRotatingFileHandler.setFormatter(formatter)
    streamHandler.setFormatter(formatter)
    logger.addHandler(timedRotatingFileHandler)
    logger.addHandler(streamHandler)
    logger.setLevel(logging.INFO)
else:
    pass

#pdb.set_trace()

obj = Os_Creation_Modules()
conn = obj.os_connection_creation()
# logger.info("Adding Aggregate and zone for each Compute Node")
#=================R146===================#

# list = ["r146-dell-compute-0.r146.nfv.lab",
#     "r146-dell-compute-1.r146.nfv.lab", "r146-dell-compute-2.r146.nfv.lab"]
# c = 0
# for i in list:
#     obj.os_aggregate_creation_and_add_host(logger, conn, "nova%s"%c, availablity_zone="nova%s"%c, host_name=i)
#     c += 1

#==================R153===================#

# list = ["r153-dell-compute-0.r153.nfv.lab", "r153-dell-compute-1.r153.nfv.lab", "r153-dell-compute-2.r153.nfv.lab"]
# c = 0
Beispiel #3
0
        "logs/%s.log" % out_file, when='midnight', interval=1, backupCount=30)
    streamHandler = logging.StreamHandler()
    timedRotatingFileHandler.setFormatter(formatter)
    streamHandler.setFormatter(formatter)
    logger.addHandler(timedRotatingFileHandler)
    logger.addHandler(streamHandler)
    logger.setLevel(logging.INFO)
else:
    pass
#########################logger code end
nova0_list = []
nova1_list = []
nova2_list = []

ssh_obj = ssh_functions()
creation_object = Os_Creation_Modules()
delete_object = Os_Deletion_Modules()

conn_create = creation_object.os_connection_creation()
conn_delete = delete_object.os_connection_creation()


def execute_tcp_dump(session, timeout, namespace_id, interface, find=None):
    global stdout_a
    try:
        #print "\nExecuting tcp dump command to capture PAD packets"
        if find is None:
            stdin_a, stdout_a, stderr_a = session.exec_command(
                "sudo ip netns exec %s timeout %s tcpdump -i %s" %
                (namespace_id, timeout, interface))
        else:
Beispiel #4
0
# Logger configuration
logger = logging.getLogger(__name__)
formatter = logging.Formatter('%(message)s')
if not logger.handlers:
    timedRotatingFileHandler = logging.handlers.TimedRotatingFileHandler(
        "logs/%s.log" % out_file, when='midnight', interval=1, backupCount=30)
    streamHandler = logging.StreamHandler()
    timedRotatingFileHandler.setFormatter(formatter)
    streamHandler.setFormatter(formatter)
    logger.addHandler(timedRotatingFileHandler)
    logger.addHandler(streamHandler)
    logger.setLevel(logging.INFO)
else:
    pass

obj = Os_Creation_Modules()
conn = obj.os_connection_creation()
# logger.info("Adding Aggregate and zone for each Compute Node")
#=================R146===================#

# list = ["r146-dell-compute-0.r146.nfv.lab",
#     "r146-dell-compute-1.r146.nfv.lab", "r146-dell-compute-2.r146.nfv.lab"]
# c = 0
# for i in list:
#     obj.os_aggregate_creation_and_add_host(logger, conn, "nova%s"%c, availablity_zone="nova%s"%c, host_name=i)
#     c += 1

#==================R153===================#

# list = ["r153-dell-compute-0.r153.nfv.lab", "r153-dell-compute-1.r153.nfv.lab", "r153-dell-compute-2.r153.nfv.lab"]
# c = 0