<commit_before>#!/usr/bin/env python
#
# Description:
#   Cleans possible leftovers after running functest tests:
#       - Nova instances
#       - Glance images
#       - Cinder volumes
#       - Floating IPs
#       - Neutron networks, subnets and ports
#       - Routers
#       - Users and tenants
#
# Author:
#    <EMAIL>
#

import argparse
import logging
import os
import re
import sys
import time

import novaclient.v2.client as novaclient
from neutronclient.v2_0 import client as neutronclient
from keystoneclient.v2_0 import client as keystoneclient
from cinderclient import client as cinderclient

parser = argparse.ArgumentParser()
parser.add_argument("repo_path", help="Path to the repository")
parser.add_argument("-d", "--debug", help="Debug mode",  action="store_true")
args = parser.parse_args()


""" logging configuration """
logger = logging.getLogger('clean_openstack')
logger.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
if args.debug:
    ch.setLevel(logging.DEBUG)
else:
    ch.setLevel(logging.INFO)

sys.path.append(args.repo_path + "testcases/")
import functest_utils

formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)

default_images = ['TestVM']
default_networks = ['net04', 'net04_ext']
default_routers = ['router04']
default_users = ["heat", "heat-cfn", "cinder", "nova", "swift", "glance",
                 "neutron", "admin", "fuel_stats_user"]
default_tenants = ["admin", "services"]
default_security_groups = ['default']

def separator():
    logger.debug("-------------------------------------------")<commit_msg>fix bug of cleaning the openstack env, the tenant"service" cannot be deleted<commit_after>#!/usr/bin/env python
#
# Description:
#   Cleans possible leftovers after running functest tests:
#       - Nova instances
#       - Glance images
#       - Cinder volumes
#       - Floating IPs
#       - Neutron networks, subnets and ports
#       - Routers
#       - Users and tenants
#
# Author:
#    <EMAIL>
#

import argparse
import logging
import os
import re
import sys
import time

import novaclient.v2.client as novaclient
from neutronclient.v2_0 import client as neutronclient
from keystoneclient.v2_0 import client as keystoneclient
from cinderclient import client as cinderclient

parser = argparse.ArgumentParser()
parser.add_argument("repo_path", help="Path to the repository")
parser.add_argument("-d", "--debug", help="Debug mode",  action="store_true")
args = parser.parse_args()


""" logging configuration """
logger = logging.getLogger('clean_openstack')
logger.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
if args.debug:
    ch.setLevel(logging.DEBUG)
else:
    ch.setLevel(logging.INFO)

sys.path.append(args.repo_path + "testcases/")
import functest_utils

formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)

default_images = ['TestVM']
default_networks = ['net04', 'net04_ext']
default_routers = ['router04']
default_users = ["heat", "heat-cfn", "cinder", "nova", "swift", "glance",
                 "neutron", "admin", "fuel_stats_user"]
default_tenants = ["admin", "services","service"]
default_security_groups = ['default']

def separator():
    logger.debug("-------------------------------------------")
{'fraction_non_alphanumeric': 0.15302173265852934, 'fraction_numerical': 0.006549568323905924, 'mean_word_length': 3.9411764705882355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '673856', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1026, 'n_words': 261}