Skip to content

Commit 9bdba6c

Browse files
author
Gabriel Monroy
committed
deprecate converge_controller
1 parent b6c4451 commit 9bdba6c

6 files changed

Lines changed: 1 addition & 52 deletions

File tree

api/models.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,22 +199,19 @@ def destroy(self, *args, **kwargs):
199199
group(layer_tasks).apply_async().join()
200200
CM.purge_formation(self.flat())
201201
self.delete()
202-
tasks.converge_controller.apply_async().wait()
203202

204203
def publish(self):
205204
data = self.calculate()
206205
CM.publish_formation(self.flat(), data)
207206
return data
208207

209-
def converge(self, controller=False, **kwargs):
208+
def converge(self, **kwargs):
210209
databag = self.publish()
211210
nodes = self.node_set.all()
212211
subtasks = []
213212
for n in nodes:
214213
subtask = tasks.converge_node.si(n)
215214
subtasks.append(subtask)
216-
if controller is True:
217-
subtasks.append(tasks.converge_controller.si())
218215
group(*subtasks).apply_async().join()
219216
return databag
220217

api/tasks.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,3 @@ def run_node(node, command):
9999
if rc != 0 and 'failed to setup the container' in output:
100100
output = '\033[35mPlease run `git push deis master` first.\033[0m\n' + output
101101
return output, rc
102-
103-
104-
@task
105-
def converge_controller():
106-
"""
107-
Converge a the controller node, aligning it with an intended configuration.
108-
"""
109-
CM.converge_controller()
110-
return None

api/views.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ class KeyViewSet(OwnerViewSet):
186186
serializer_class = serializers.KeySerializer
187187
lookup_field = 'id'
188188

189-
def post_save(self, key, created=False, **kwargs):
190-
tasks.converge_controller.apply_async().wait()
191-
192189

193190
class ProviderViewSet(OwnerViewSet):
194191
"""RESTful views for :class:`~api.models.Provider`."""
@@ -379,7 +376,6 @@ def create(self, request, **kwargs):
379376
user = get_object_or_404(User, username=request.DATA['username'])
380377
assign_perm(self.perm, user, app)
381378
app.publish()
382-
tasks.converge_controller.apply_async().wait()
383379
models.log_event(app, "User {} was granted access to {}".format(user, app))
384380
return Response(status=status.HTTP_201_CREATED)
385381

@@ -391,7 +387,6 @@ def destroy(self, request, **kwargs):
391387
if user.has_perm(self.perm, app):
392388
remove_perm(self.perm, user, app)
393389
app.publish()
394-
tasks.converge_controller.apply_async().wait()
395390
models.log_event(app, "User {} was revoked access to {}".format(user, app))
396391
return Response(status=status.HTTP_204_NO_CONTENT)
397392
else:

cm/chef.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -158,25 +158,6 @@ def purge_node(node):
158158
raise RuntimeError("Could not purge node client {node_id}: {body}".format(**locals()))
159159

160160

161-
def converge_controller():
162-
"""
163-
Converge this controller node.
164-
165-
"Converge" means to change a node's configuration to match that defined by
166-
configuration management.
167-
168-
:returns: the output of the convergence command, in this case `sudo chef-client`
169-
"""
170-
#try:
171-
# # we only need to run the gitosis recipe to update `git push` ACLs
172-
# return subprocess.check_output(['sudo', 'chef-client', '-o', 'recipe[deis::gitosis]'])
173-
#except subprocess.CalledProcessError as err:
174-
# print(err)
175-
# print(err.output)
176-
# raise err
177-
pass # TODO: replace this with new key lookup
178-
179-
180161
def converge_node(node):
181162
"""
182163
Converge a node.

cm/mock.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,3 @@ def purge_formation(formation):
144144
"""
145145
path = os.path.join(settings.TEMPDIR, 'formation-{id}'.format(**formation))
146146
os.remove(path)
147-
148-
149-
def converge_controller():
150-
"""
151-
Converge this controller node.
152-
153-
"Converge" means to change a node's configuration to match that defined by
154-
configuration management.
155-
156-
This is a no-op for the mock provider.
157-
158-
:returns: the output of the convergence command, in this case None
159-
"""
160-
return None

docs/server/api.tasks.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ api.tasks
1919
.. autofunction:: destroy_node(node)
2020
.. autofunction:: converge_node(node)
2121
.. autofunction:: run_node(node, command)
22-
.. autofunction:: converge_controller()

0 commit comments

Comments
 (0)