Browse Source

Remove the unused tripleo.plan.update_plan_environment Mistral action

This action isn't used or tested.

Change-Id: Iaa57ce63e2ec9b3c72312500f53f35d3ca1a2849
tags/11.2.0
Dougal Matthews 1 month ago
parent
commit
6cb8048a25
2 changed files with 0 additions and 57 deletions
  1. 0
    1
      setup.cfg
  2. 0
    56
      tripleo_common/actions/plan.py

+ 0
- 1
setup.cfg View File

@@ -126,7 +126,6 @@ mistral.actions =
126 126
     tripleo.plan.export = tripleo_common.actions.plan:ExportPlanAction
127 127
     tripleo.plan.update_from_dir = tripleo_common.actions.plan:UpdatePlanFromDirAction
128 128
     tripleo.plan.update_networks = tripleo_common.actions.plan:UpdateNetworksAction
129
-    tripleo.plan.update_plan_environment = tripleo_common.actions.plan:UpdatePlanEnvironmentAction
130 129
     tripleo.plan.update_roles = tripleo_common.actions.plan:UpdateRolesAction
131 130
     tripleo.plan.validate_roles = tripleo_common.actions.plan:ValidateRolesDataAction
132 131
     tripleo.plan.remove_noop_deploystep = tripleo_common.actions.plan:RemoveNoopDeployStepAction

+ 0
- 56
tripleo_common/actions/plan.py View File

@@ -288,62 +288,6 @@ class UpdatePlanFromDirAction(base.TripleOAction):
288 288
             return actions.Result(error=msg)
289 289
 
290 290
 
291
-class UpdatePlanEnvironmentAction(base.TripleOAction):
292
-    """Updates the plan environment values
293
-
294
-    Updates a plan environment values - when parameter is specified
295
-    the value is merged with the env_key (useful for parameter_defaults)
296
-    otherwise the value for env_key is replaced.
297
-
298
-    :param env_key: environment key that should be one of the keys present
299
-                    in the plan environment dictionary
300
-    :param parameter: key value of the parameter add/delete/modify
301
-    :param value: value of the parameter or of env_key when no parameter
302
-    :param delete: True if the parameter should be deleted from env_key
303
-    :param container: name of the Swift container / plan name
304
-    """
305
-
306
-    def __init__(self, env_key, parameter=None, value=None, delete=False,
307
-                 container=constants.DEFAULT_CONTAINER_NAME):
308
-        super(UpdatePlanEnvironmentAction, self).__init__()
309
-        self.container = container
310
-        self.parameter = parameter
311
-        self.value = value
312
-        self.delete = delete
313
-        self.env_key = env_key
314
-
315
-    def run(self, context):
316
-        try:
317
-            swift = self.get_object_client(context)
318
-            plan_env = plan_utils.get_env(swift, self.container)
319
-
320
-            if self.env_key not in plan_env:
321
-                msg = "The environment key doesn't exist: %s" % self.env_key
322
-                return actions.Result(error=msg)
323
-
324
-            if self.delete:
325
-                if not self.parameter:
326
-                    raise ValueError("delete must specify a parameter")
327
-                plan_env[self.env_key].pop(self.parameter, None)
328
-            elif self.parameter:
329
-                plan_env[self.env_key][self.parameter] = self.value
330
-            elif self.value is not None:
331
-                plan_env[self.env_key] = self.value
332
-            else:
333
-                # Nothing to modify
334
-                return
335
-
336
-            plan_utils.update_in_env(swift, plan_env,
337
-                                     self.env_key,
338
-                                     value=plan_env[self.env_key])
339
-        except swiftexceptions.ClientException as err:
340
-            msg = "Error attempting an operation on container: %s" % err
341
-            return actions.Result(error=msg)
342
-        except Exception as err:
343
-            msg = "Error while updating plan: %s" % err
344
-            return actions.Result(error=msg)
345
-
346
-
347 291
 class UpdateNetworksAction(base.TripleOAction):
348 292
     def __init__(self, networks, current_networks, replace_all=False):
349 293
         super(UpdateNetworksAction, self).__init__()

Loading…
Cancel
Save