diff options
author | 2016-12-19 11:06:36 +0800 | |
---|---|---|
committer | 2016-12-20 15:05:03 +0800 | |
commit | 819912d0379f6cd2b2693c2968576f7514a117c5 (patch) | |
tree | e24d274484fa1ec8976c9f1bd44f5ee6e445724b /deploy/adapters/ansible/openstack_mitaka/roles/onos_cluster/files/setup_networks/log.py | |
parent | eb5dbdac42b1b7b775fbc1dc513376425a6898ff (diff) |
master only support newton
JIRA: COMPASS-513
Remove other roles and ppa, master only support newton.
Change-Id: I47ddb16baa25902c3e05cc7f9d0d6430f5dc7e00
Signed-off-by: liyuenan <liyuenan@huawei.com>
Diffstat (limited to 'deploy/adapters/ansible/openstack_mitaka/roles/onos_cluster/files/setup_networks/log.py')
-rw-r--r-- | deploy/adapters/ansible/openstack_mitaka/roles/onos_cluster/files/setup_networks/log.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/deploy/adapters/ansible/openstack_mitaka/roles/onos_cluster/files/setup_networks/log.py b/deploy/adapters/ansible/openstack_mitaka/roles/onos_cluster/files/setup_networks/log.py deleted file mode 100644 index a22ff0fe..00000000 --- a/deploy/adapters/ansible/openstack_mitaka/roles/onos_cluster/files/setup_networks/log.py +++ /dev/null @@ -1,43 +0,0 @@ -import logging -import os -loggers = {} -log_dir = "/var/log/setup_network" -try: - os.makedirs(log_dir) -except: - pass - - -def getLogger(name): - if name in loggers: - return loggers[name] - - logger = logging.getLogger(name) - logger.setLevel(logging.DEBUG) - - # create file handler which logs even debug messages - log_file = "%s/%s.log" % (log_dir, name) - try: - os.remove(log_file) - except: - pass - - fh = logging.FileHandler(log_file) - fh.setLevel(logging.DEBUG) - - # create console handler with a higher log level - ch = logging.StreamHandler() - ch.setLevel(logging.ERROR) - - # create formatter and add it to the handlers - formatter = logging.Formatter( - "%(asctime)s - %(name)s - %(levelname)s - %(message)s") - ch.setFormatter(formatter) - fh.setFormatter(formatter) - - # add the handlers to logger - logger.addHandler(ch) - logger.addHandler(fh) - - loggers[name] = logger - return logger |