salt icon indicating copy to clipboard operation
salt copied to clipboard

salt.runners.cloud.action fun parameter is replaced

Open iamfil opened this issue 11 years ago • 2 comments

When using salt.runners.cloud.action with Reactor, the fun argument is replaced. For example, the following sls should rename a ec2 instance:

rename-ec2-instance:
  runner.cloud.action:
    - fun: rename
    - instances:
      - InstanceName
    - name: InstanceName
    - newname: NewInstanceName

but instead it will fail with:

'ec2.None' is not available. Not actioning...

This occurs because https://github.com/saltstack/salt/blob/develop/salt/state.py#L549 replaces the fun specified in the sls with cloud.action.

Changing the 'fun' parameter in http://docs.saltstack.com/en/latest/ref/runners/all/salt.runners.cloud.html#salt.runners.cloud.action to something else such as 'action' and also using 'action' instead of 'fun' in the above sls allows for this to work. Not sure if this the best way to fix this though. If it is, I can submit a patch. I believe other runners that use the fun parameter will run into a similar issue.

iamfil avatar May 06 '15 04:05 iamfil

@iamfil, thanks for the report. I am not sure what the correct approach is here either although if you want to write some code changes, I'll be glad to review it with you.

jfindlay avatar May 06 '15 20:05 jfindlay

Yes, I think that changing the cloud runner is the thing to do here.

cachedout avatar May 06 '15 21:05 cachedout