Skip to content

Commit 588b363

Browse files
authored
Remove unused Commands (#146)
1 parent e4d3c64 commit 588b363

6 files changed

Lines changed: 306 additions & 273 deletions

File tree

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v0.8.2
1+
v1.0.0

ckan_cloud_operator/cli.py

Lines changed: 117 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -49,123 +49,132 @@ def main(debug):
4949
pass
5050

5151

52-
main.add_command(providers_cli.providers_group, 'providers')
53-
main.add_command(db_cli.db_group, 'db')
54-
main.add_command(cluster_cli.cluster)
55-
main.add_command(users_cli.users)
56-
main.add_command(crds_cli.crds)
57-
main.add_command(config_cli.config)
5852
main.add_command(ckan_cli.ckan)
59-
main.add_command(storage_cli.storage)
60-
main.add_command(solr_cli.solr)
61-
main.add_command(apps_cli.apps)
62-
63-
64-
@main.group()
65-
def drivers():
66-
pass
67-
68-
69-
drivers.add_command(driver_postgres_cli.postgres)
70-
drivers.add_command(driver_kubectl_cli.kubectl)
71-
drivers.add_command(driver_rancher_cli.rancher)
72-
drivers.add_command(driver_jenkins_cli.jenkins)
73-
drivers.add_command(driver_helm_cli.helm)
74-
75-
76-
@main.command('kubectl')
77-
@click.argument('ARG', nargs=-1)
78-
def kubectl_command(arg):
79-
from ckan_cloud_operator import kubectl
80-
kubectl.check_call(' '.join(arg))
81-
82-
83-
@main.command()
84-
@click.argument('GITLAB_PROJECT_NAME')
85-
@click.argument('GIT_BRANCH', default='master')
86-
@click.option('-w', '--wait-ready', is_flag=True)
87-
def initialize_gitlab(gitlab_project_name, git_branch, wait_ready):
88-
"""Initialize the gitlab integration
89-
90-
Example:
91-
92-
ckan-cloud-operator initialize-gitlab repo/project
93-
"""
94-
ckan_gitlab = CkanGitlab()
95-
ckan_gitlab.initialize(gitlab_project_name, git_branch)
96-
if wait_ready and not ckan_gitlab.is_ready(gitlab_project_name):
97-
logs.info(f'Waiting for GitLab project {gitlab_project_name} to be ready...')
98-
while not ckan_gitlab.is_ready(gitlab_project_name):
99-
time.sleep(5)
100-
great_success()
101-
102-
103-
@main.command()
104-
def activate_gcloud_auth():
105-
"""Authenticate with gcloud CLI using the ckan-cloud-operator credentials"""
106-
from ckan_cloud_operator.providers.cluster.gcloud import manager as gcloud_manager
107-
gcloud_manager.activate_auth()
108-
109-
110-
@main.command()
111-
def bash_completion():
112-
"""Return bash completion script which should be eval'd"""
113-
subprocess.check_call('echo "$(_CKAN_CLOUD_OPERATOR_COMPLETE=source ckan-cloud-operator)"', shell=True)
114-
print('# ')
115-
print('# To enable Bash completion, use the following command:')
116-
print('# eval "$(ckan-cloud-operator bash-completion)"')
53+
main.add_command(cluster_cli.cluster)
11754

11855

56+
############################################################################
57+
## Commands Below are not used for now and are making unnecessary noise ##
58+
## I'm commenting them for now, but not deleting as they might be useful ##
59+
## In future. Will bring them back as needed ##
60+
############################################################################
61+
#
62+
#
63+
# main.add_command(users_cli.users)
64+
# main.add_command(db_cli.db_group, 'db')
65+
# main.add_command(providers_cli.providers_group, 'providers')
66+
# main.add_command(crds_cli.crds)
67+
# main.add_command(config_cli.config)
68+
# main.add_command(storage_cli.storage)
69+
# main.add_command(solr_cli.solr)
70+
# main.add_command(apps _cli.apps)
71+
#
72+
#
73+
# @main.group()
74+
# def drivers():
75+
# pass
76+
#
77+
#
78+
# drivers.add_command(driver_postgres_cli.postgres)
79+
# drivers.add_command(driver_kubectl_cli.kubectl)
80+
# drivers.add_command(driver_rancher_cli.rancher)
81+
# drivers.add_command(driver_jenkins_cli.jenkins)
82+
# drivers.add_command(driver_helm_cli.helm)
83+
#
84+
#
85+
# @main.command('kubectl')
86+
# @click.argument('ARG', nargs=-1)
87+
# def kubectl_command(arg):
88+
# from ckan_cloud_operator import kubectl
89+
# kubectl.check_call(' '.join(arg))
90+
#
91+
#
92+
# @main.command()
93+
# @click.argument('GITLAB_PROJECT_NAME')
94+
# @click.argument('GIT_BRANCH', default='master')
95+
# @click.option('-w', '--wait-ready', is_flag=True)
96+
# def initialize_gitlab(gitlab_project_name, git_branch, wait_ready):
97+
# """Initialize the gitlab integration
98+
#
99+
# Example:
100+
#
101+
# ckan-cloud-operator initialize-gitlab repo/project
102+
# """
103+
# ckan_gitlab = CkanGitlab()
104+
# ckan_gitlab.initialize(gitlab_project_name, git_branch)
105+
# if wait_ready and not ckan_gitlab.is_ready(gitlab_project_name):
106+
# logs.info(f'Waiting for GitLab project {gitlab_project_name} to be ready...')
107+
# while not ckan_gitlab.is_ready(gitlab_project_name):
108+
# time.sleep(5)
109+
# great_success()
110+
#
111+
#
112+
# @main.command()
113+
# def activate_gcloud_auth():
114+
# """Authenticate with gcloud CLI using the ckan-cloud-operator credentials"""
115+
# from ckan_cloud_operator.providers.cluster.gcloud import manager as gcloud_manager
116+
# gcloud_manager.activate_auth()
117+
#
118+
#
119+
# @main.command()
120+
# def bash_completion():
121+
# """Return bash completion script which should be eval'd"""
122+
# subprocess.check_call('echo "$(_CKAN_CLOUD_OPERATOR_COMPLETE=source ckan-cloud-operator)"', shell=True)
123+
# print('# ')
124+
# print('# To enable Bash completion, use the following command:')
125+
# print('# eval "$(ckan-cloud-operator bash-completion)"')
126+
#
127+
#
119128
# @main.group()
120129
# def users():
121130
# """Manage ckan-cloud-operator users"""
122131
# pass
123132
#
124133
# ckan_cloud_operator.providers.users.add_cli_commands(click, users, great_success)
125-
126-
127-
@main.group()
128-
def ckan_infra():
129-
"""Manage the centralized infrastructure"""
130-
pass
131-
132-
133-
CkanInfra.add_cli_commands(click, ckan_infra, great_success)
134-
135-
136-
@main.group()
137-
def deis_instance():
138-
"""Manage Deis CKAN instance resources"""
139-
pass
140-
141-
142-
DeisCkanInstance.add_cli_commands(click, deis_instance, great_success)
143-
144-
145-
@main.group()
146-
def routers():
147-
"""Manage CKAN Cloud routers"""
148-
pass
149-
150-
151-
ckan_cloud_operator.routers.cli.add_cli_commands(click, routers, great_success)
152-
153-
154-
@main.group()
155-
def datapushers():
156-
"""Manage centralized CKAN DataPushers"""
157-
pass
158-
159-
160-
ckan_cloud_operator.datapushers.add_cli_commands(click, datapushers, great_success)
161-
162-
163-
@main.command()
164-
def test():
165-
"""Run unittest suite and report coverage"""
166-
subprocess.check_call('coverage run -m unittest discover', shell=True)
167-
subprocess.check_call('coverage report', shell=True)
134+
#
135+
#
136+
# @main.group()
137+
# def ckan_infra():
138+
# """Manage the centralized infrastructure"""
139+
# pass
140+
#
141+
#
142+
# CkanInfra.add_cli_commands(click, ckan_infra, great_success)
143+
#
144+
#
145+
# @main.group()
146+
# def deis_instance():
147+
# """Manage Deis CKAN instance resources"""
148+
# pass
149+
#
150+
#
151+
# DeisCkanInstance.add_cli_commands(click, deis_instance, great_success)
152+
#
153+
#
154+
# @main.group()
155+
# def routers():
156+
# """Manage CKAN Cloud routers"""
157+
# pass
158+
#
159+
#
160+
# ckan_cloud_operator.routers.cli.add_cli_commands(click, routers, great_success)
161+
#
162+
#
163+
# @main.group()
164+
# def datapushers():
165+
# """Manage centralized CKAN DataPushers"""
166+
# pass
167+
#
168+
#
169+
# ckan_cloud_operator.datapushers.add_cli_commands(click, datapushers, great_success)
170+
#
171+
#
172+
# @main.command()
173+
# def test():
174+
# """Run unittest suite and report coverage"""
175+
# subprocess.check_call('coverage run -m unittest discover', shell=True)
176+
# subprocess.check_call('coverage report', shell=True)
168177

169178

170179
if __name__ == '__main__':
171-
main()
180+
main()

ckan_cloud_operator/deis_ckan/ckan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def paster(self, paster_command=None, *paster_args):
2424
self.exec(cmd)
2525

2626
def admin_credentials(self):
27-
data = kubectl.decode_secret(kubectl.get('secret', 'ckan-envvars', namespace=self.instance.id))
27+
data = kubectl.decode_secret(kubectl.get('secret', 'ckan-env-vars', namespace=self.instance.id))
2828
return {
2929
'sysadmin-name': data['CKAN_SYSADMIN_NAME'],
3030
'sysadmin-password': data['CKAN_SYSADMIN_PASSWORD'],

0 commit comments

Comments
 (0)