Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VMware: vcenter_folder: print full path of the new folder #55237

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
3 participants
@goneri
Copy link
Contributor

commented Apr 12, 2019

SUMMARY

Print the full path of the freshly created folder in the output string.
e.g:

ok: [testhost] => {
    "msg": {
        "changed": true,
        "failed": false,
        "msg": "Folder 'Staging' of type 'host' created successfully.",
        "path": "/dc1/host/Staging"
    }
}
ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

vcenter_folder

@goneri goneri force-pushed the goneri:folder_full_path branch from 4d6b432 to 9883756 Apr 12, 2019

@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Apr 12, 2019

@goneri, just so you are aware we have a dedicated Working Group for vmware.
You can find other people interested in this in #ansible-vmware on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

vcenter_folder: print full path of the new folder
Print the full path of the freshly created folder in the output string.
e.g:

```
ok: [testhost] => {
    "msg": {
        "changed": true,
        "failed": false,
        "msg": "Folder 'Staging' of type 'host' created successfully.",
        "path": "/dc1/host/Staging"
    }
}
```

@goneri goneri force-pushed the goneri:folder_full_path branch from 9883756 to 5c9500a Apr 13, 2019

@Akasurde Akasurde removed the needs_triage label Apr 14, 2019

@Akasurde Akasurde self-requested a review Apr 14, 2019

@Akasurde Akasurde self-assigned this Apr 14, 2019

@Akasurde
Copy link
Member

left a comment

Could you please write integration test for this change ? Thanks.

@@ -1382,3 +1382,12 @@ def to_json(self, obj, properties=None):
else:
result = self._jsonify(obj)
return result

def get_folder_path(self, cur):

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 14, 2019

Member

Can we use get_vm_path ?

This comment has been minimized.

Copy link
@goneri

goneri Apr 15, 2019

Author Contributor

Yes probably indeed.

@@ -163,7 +163,7 @@ def ensure(self):
folder_type = self.module.params.get('folder_type')
folder_name = self.module.params.get('folder_name')
parent_folder = self.module.params.get('parent_folder', None)
results = dict(changed=False, result=dict())
results = {'changed': False, 'msg': ''}

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 14, 2019

Member

I would suggestion to keep result=dict() as it is for backward compatibility. Add new keys path and msg as new keys in dict.

@@ -181,44 +181,48 @@ def ensure(self):
folder_type=folder_type,
parent_folder=p_folder_obj)
if child_folder_obj:
results['result'] = "Folder %s already exists under" \
" parent folder %s" % (folder_name, parent_folder)
results['path'] = self.get_folder_path(child_folder_obj)

This comment has been minimized.

Copy link
@Akasurde

Akasurde Apr 14, 2019

Member

Add a sample example in RETURN documentation for this change.

@Akasurde Akasurde changed the title vcenter_folder: print full path of the new folder VMware: vcenter_folder: print full path of the new folder Apr 14, 2019

@ansibot ansibot added the stale_ci label Apr 23, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.