mantis-cli 14.2.0__tar.gz → 14.3.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mantis-cli-14.2.0/mantis_cli.egg-info → mantis-cli-14.3.0}/PKG-INFO +1 -1
- mantis-cli-14.3.0/mantis/__init__.py +1 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/helpers.py +17 -7
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/logic.py +1 -1
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/managers.py +1 -1
- {mantis-cli-14.2.0 → mantis-cli-14.3.0/mantis_cli.egg-info}/PKG-INFO +1 -1
- mantis-cli-14.2.0/mantis/__init__.py +0 -1
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/.gitignore +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/LICENSE +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/MANIFEST.in +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/README.md +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/TODO +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/__main__.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/command_line.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/crypto.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/environment.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/extensions/__init__.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/extensions/django.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/extensions/nginx.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis/extensions/postgres.py +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis_cli.egg-info/SOURCES.txt +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis_cli.egg-info/dependency_links.txt +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis_cli.egg-info/entry_points.txt +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis_cli.egg-info/requires.txt +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/mantis_cli.egg-info/top_level.txt +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/setup.cfg +0 -0
- {mantis-cli-14.2.0 → mantis-cli-14.3.0}/setup.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
VERSION = '14.3.0'
|
|
@@ -83,35 +83,45 @@ def random_string(n=10):
|
|
|
83
83
|
return ''.join(random.choice(chars) for _ in range(n))
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
def find_config():
|
|
87
|
-
DEFAULT_PATH = 'configs/mantis.json'
|
|
86
|
+
def find_config(environment_id=None):
|
|
88
87
|
env_path = os.environ.get('MANTIS_CONFIG', None)
|
|
89
88
|
|
|
90
89
|
if env_path and env_path != '':
|
|
91
90
|
CLI.info(f'Mantis config defined by environment variable $MANTIS_CONFIG: {env_path}')
|
|
92
91
|
return env_path
|
|
93
92
|
|
|
94
|
-
CLI.
|
|
93
|
+
CLI.info('Environment variable $MANTIS_CONFIG not found. Looking for file mantis.json...')
|
|
95
94
|
paths = os.popen('find . -name mantis.json').read().strip().split('\n')
|
|
96
95
|
|
|
97
96
|
# Remove empty strings
|
|
98
97
|
paths = list(filter(None, paths))
|
|
99
98
|
|
|
99
|
+
# Count found mantis files
|
|
100
100
|
total_mantis_files = len(paths)
|
|
101
101
|
|
|
102
|
+
# No mantis file found
|
|
102
103
|
if total_mantis_files == 0:
|
|
103
|
-
|
|
104
|
+
DEFAULT_PATH = 'configs/mantis.json'
|
|
105
|
+
CLI.info(f'mantis.json file not found. Using default value: {DEFAULT_PATH}')
|
|
104
106
|
return DEFAULT_PATH
|
|
105
107
|
|
|
108
|
+
# Single mantis file found
|
|
106
109
|
if total_mantis_files == 1:
|
|
107
110
|
CLI.info(f'Found 1 mantis.json file: {paths[0]}')
|
|
108
111
|
return paths[0]
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
CLI.
|
|
113
|
+
# Multiple mantis files found
|
|
114
|
+
CLI.info(f'Found {total_mantis_files} mantis.json files:')
|
|
112
115
|
|
|
113
116
|
for index, path in enumerate(paths):
|
|
114
|
-
|
|
117
|
+
config_connections = load_config(path).get('connections', {}).keys()
|
|
118
|
+
connection_for_environment_exists = environment_id in config_connections
|
|
119
|
+
|
|
120
|
+
if connection_for_environment_exists:
|
|
121
|
+
CLI.success(f'[{index+1}] {path}')
|
|
122
|
+
else:
|
|
123
|
+
CLI.warning(f'[{index+1}] {path}')
|
|
124
|
+
|
|
115
125
|
CLI.danger(f'[0] Exit now and define $MANTIS_CONFIG environment variable')
|
|
116
126
|
|
|
117
127
|
path_index = None
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
VERSION = '14.2.0'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|