From: John Spray Date: Thu, 30 Jun 2016 23:12:47 +0000 (+0100) Subject: pybind/mgr: remove unused CalamariConfig X-Git-Tag: v11.0.1~60^2~48 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a53dc646554b54a0c53acfccd618edd0011d3807;p=ceph.git pybind/mgr: remove unused CalamariConfig No longer need to set CALAMARI_CONFIG when running. Signed-off-by: John Spray --- diff --git a/src/pybind/mgr/calamari.conf b/src/pybind/mgr/calamari.conf deleted file mode 100644 index 563aca8f01f0..000000000000 --- a/src/pybind/mgr/calamari.conf +++ /dev/null @@ -1,43 +0,0 @@ - -[cthulhu] - -plugin_path = -salt_config_path = -alembic_config_path = -db_path = -log_path = /tmp/cthulhu.log -log_level = DEBUG -rpc_url = -crush_host_type = host -crush_osd_type = osd -cluster_map_retention = 3600 -db_log_level = WARN -favorite_timeout_factor = 3 -server_timeout_factor = 3 -cluster_contact_threshold = 60 -emit_events_to_salt_event_bus = False -event_tag_prefix = calamari/ - -[calamari_web] - -log_path = /Users/john/git/calamari/dev/calamari.log -log_level = DEBUG -db_engine = django.db.backends.postgresql_psycopg2 -db_name = calamari -db_user = calamari -db_password = 27HbZwr*g -db_host = localhost -secret_key_path = /Users/john/git/calamari/dev/secret.key -username = john -static_root = /Users/john/git/calamari/webapp/content/ - -[graphite] - -root = /Users/john/git/calamari/env -storage_path = /Users/john/git/calamari/env/storage - -[testing] - -calamari_control = embedded -ceph_control = embedded -external_cluster_path = /Users/john/git/calamari/cluster.yaml diff --git a/src/pybind/mgr/calamari_rest/config.py b/src/pybind/mgr/calamari_rest/config.py deleted file mode 100644 index 159ced7ed882..000000000000 --- a/src/pybind/mgr/calamari_rest/config.py +++ /dev/null @@ -1,39 +0,0 @@ -import os -import ConfigParser - -try: - import alembic -except ImportError: - alembic = None -else: - import alembic.config - - -class ConfigNotFound(Exception): - pass - - -DEFAULT_CONFIG_PATH = "/etc/calamari/calamari.conf" -CONFIG_PATH_VAR = "CALAMARI_CONFIG" - - -class CalamariConfig(ConfigParser.SafeConfigParser): - def __init__(self): - ConfigParser.SafeConfigParser.__init__(self) - - try: - self.path = os.environ[CONFIG_PATH_VAR] - except KeyError: - self.path = DEFAULT_CONFIG_PATH - - if not os.path.exists(self.path): - raise ConfigNotFound("Configuration not found at %s" % self.path) - - self.read(self.path) - - -if alembic is not None: - class AlembicConfig(alembic.config.Config): - def __init__(self): - path = CalamariConfig().get('cthulhu', 'alembic_config_path') - super(AlembicConfig, self).__init__(path) diff --git a/src/pybind/mgr/calamari_rest/settings.py b/src/pybind/mgr/calamari_rest/settings.py index 54c94f91bb7b..4d555d59866f 100644 --- a/src/pybind/mgr/calamari_rest/settings.py +++ b/src/pybind/mgr/calamari_rest/settings.py @@ -1,9 +1,5 @@ # Django settings for calamari project. - -from calamari_rest.config import CalamariConfig -config = CalamariConfig() - DEBUG = False TEMPLATE_DEBUG = DEBUG diff --git a/src/pybind/mgr/calamari_rest/views/rpc_view.py b/src/pybind/mgr/calamari_rest/views/rpc_view.py index 7399bbbaa379..937400cd3fb7 100644 --- a/src/pybind/mgr/calamari_rest/views/rpc_view.py +++ b/src/pybind/mgr/calamari_rest/views/rpc_view.py @@ -14,11 +14,8 @@ from rest_framework.views import APIView from rest_framework.response import Response -from calamari_rest.config import CalamariConfig - from calamari_rest.types import OsdMap, SYNC_OBJECT_STR_TYPE, OSD, OSD_MAP, POOL, CLUSTER, CRUSH_RULE, ServiceId,\ NotFound, SERVER -config = CalamariConfig() from rest import global_instance as rest_plugin