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

aci_tenant: New module to manage tenants on ACI fabric #26836

Merged
merged 4 commits into from
Aug 9, 2017

Conversation

schunduri
Copy link
Contributor

SUMMARY

Cisco ACI Module

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME
ANSIBLE VERSION
ansible 2.4.0 (devel 489aefe807) last updated 2017/07/14 17:43:27 (GMT -700)
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/ansible/lib/ansible
  executable location = /home/user/ansible/bin/ansible
  python version = 2.7.6 (default, Jun 22 2015, 17:58:13) [GCC 4.8.2]
ADDITIONAL INFORMATION

@ansibot ansibot added affects_2.4 This issue/PR affects Ansible v2.4 needs_triage Needs a first human triage before being processed. new_plugin This PR includes a new plugin. support:core This issue/PR relates to code supported by the Ansible Engineering Team. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jul 15, 2017
@bcoca bcoca added support:community This issue/PR relates to code supported by the Ansible community. and removed needs_triage Needs a first human triage before being processed. labels Jul 17, 2017
@mattclay mattclay added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Jul 18, 2017
@ansibot ansibot added module This issue/PR relates to a module. networking Network category new_module This PR includes a new module. labels Jul 18, 2017
@ansibot
Copy link
Contributor

ansibot commented Jul 19, 2017

@schunduri this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot ansibot added the merge_commit This PR contains at least one merge commit. Please resolve! label Jul 19, 2017
@ansibot
Copy link
Contributor

ansibot commented Jul 19, 2017

@schunduri this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibot
Copy link
Contributor

ansibot commented Jul 19, 2017

The test ansible-test sanity --test validate-modules failed with the following errors:

lib/ansible/modules/network/aci/aci_tenant.py:0:0: E305 DOCUMENTATION.version_added: required key not provided @ data['version_added']. Got None
lib/ansible/modules/network/aci/aci_tenant.py:0:0: E307 version_added should be 2.4. Currently 0.0

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Jul 19, 2017
@ansibot ansibot removed ci_verified Changes made in this PR are causing tests to fail. merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Jul 19, 2017
@ansibot
Copy link
Contributor

ansibot commented Jul 19, 2017

The test ansible-test sanity --test validate-modules failed with the following errors:

lib/ansible/modules/network/aci/aci_tenant.py:0:0: E305 DOCUMENTATION.version_added: required key not provided @ data['version_added']. Got None
lib/ansible/modules/network/aci/aci_tenant.py:0:0: E307 version_added should be 2.4. Currently 0.0

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. and removed ci_verified Changes made in this PR are causing tests to fail. labels Jul 19, 2017
@ansibot
Copy link
Contributor

ansibot commented Jul 20, 2017

@jedelman8 @schunduri

As a maintainer of a module in the same namespace this new module has been submitted to, your vote counts for shipits. Please review this module and add shipit if you would like to see it merged.

click here for bot help

@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Jul 20, 2017
---

module: aci_tenant
short_description: Direct access to the APIC API
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add "cisco" and "ACI" into the short_description, it will make it easier for people to find.
Direct access to the Cisco ACI APIC API
Feel free to change the wording to match how you market this.

hostname=dict(type='str', required=True, aliases=['host']),
username=dict(type='str', default='admin', aliases=['user']),
password=dict(type='str', required=True, no_log=True),
protocol=dict(type='str'), # Deprecated in v2.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please change to:
protocol=dict(type='str', removed_in_version='2.6'), # Deprecated in v2.6

So this matches #27070


import json

# from ansible.module_utils.aci import aci_argument_spec, aci_login, aci_response
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove commented out code

username = module.params['username']
password = module.params['password']

# FIXME: This should not be needed
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gundalow I will make the required changes. Thank you

@gundalow
Copy link
Contributor

@dagwieers Did you want to review this?

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jul 24, 2017
@gundalow gundalow removed virt Virt community (incl. QEMU, KVM, libvirt, ovirt, RHV and Proxmox) vmware VMware community labels Aug 4, 2017
@alikins
Copy link
Contributor

alikins commented Aug 7, 2017

Please reopen when the git branch issues are resolved.

Having so many changed files in a pr is causing some problems with repo info tools (like https://ansible.sivel.net/byfile.html) so closing for now.

@alikins alikins closed this Aug 7, 2017
@jctanner
Copy link
Contributor

jctanner commented Aug 7, 2017

per @dagwieers on irc, this is about to get some rebasing and the submitter would like it reopened.

@ansibot
Copy link
Contributor

ansibot commented Aug 8, 2017

The test ansible-test sanity --test boilerplate failed with the following error:

Command "test/sanity/code-smell/boilerplate.sh" returned exit status 2.
>>> Standard Output
== Missing __metaclass__ = type ==
./lib/ansible/modules/network/aci/aci_tenant.py

== Missing from __future__ import (absolute_import, division, print_function) ==
./lib/ansible/modules/network/aci/aci_tenant.py

The test ansible-test sanity --test validate-modules failed with the following error:

lib/ansible/modules/network/aci/aci_tenant.py:0:0: E101 Interpreter line is not "#!/usr/bin/python"

click here for bot help

@ansibot ansibot added module This issue/PR relates to a module. new_module This PR includes a new module. and removed needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Aug 8, 2017
@mattclay mattclay added the ci_verified Changes made in this PR are causing tests to fail. label Aug 8, 2017
@ansibot
Copy link
Contributor

ansibot commented Aug 8, 2017

The test ansible-test sanity --test import --python 2.6 failed with the following error:

lib/ansible/modules/network/aci/aci_tenant.py:6:0: SyntaxError: from __future__ imports must occur at the beginning of the file

The test ansible-test sanity --test import --python 2.7 failed with the following error:

lib/ansible/modules/network/aci/aci_tenant.py:6:0: SyntaxError: from __future__ imports must occur at the beginning of the file

The test ansible-test sanity --test import --python 3.5 failed with the following error:

lib/ansible/modules/network/aci/aci_tenant.py:6:0: SyntaxError: from __future__ imports must occur at the beginning of the file

The test ansible-test sanity --test import --python 3.6 failed with the following error:

lib/ansible/modules/network/aci/aci_tenant.py:6:0: SyntaxError: from __future__ imports must occur at the beginning of the file

The test ansible-test sanity --test validate-modules failed with the following error:

lib/ansible/modules/network/aci/aci_tenant.py:0:0: E101 Interpreter line is not "#!/usr/bin/python"

click here for bot help

@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Aug 8, 2017
@calfonso calfonso dismissed gundalow’s stale review August 9, 2017 13:08

Review points made have been resolved

@calfonso calfonso merged commit 3241b71 into ansible:devel Aug 9, 2017
if state == 'query':
aci.request(path)
elif module.check_mode:
# TODO: Implement proper check-mode (presence check)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @calfonso shouldn't we want a real check mode if the module says it supports it? This blindly returns changed=True in check mode all the time.

/cc @dagwieers @devarshishah3

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedelman8 you're right. @schunduri ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, so we plan to fix this and @jedelman8 and @jmcgill298 are involved in some new code that may help with this. However if this does not hit the tree before the freeze I will make sure this module is pulled from the tree.

It is unfortunate this PR was merged, but granted the PR should have been indicated with a WIP-tag to have prevented this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have submitted a couple of modules with the new approach that takes care of check-mode. I am waiting to hear back from @schunduri that this approach is acceptable before continuing to enhance other modules being developed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jedelman8, we can change the module to check mode not supported for now

@dagwieers dagwieers changed the title Cisco ACI New Module PR aci_tenant: New module to manage tenants on ACI fabric Aug 11, 2017
@dagwieers dagwieers added the aci Cisco ACI community label Sep 27, 2017
@dagwieers dagwieers added the cisco Cisco technologies label Feb 23, 2019
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
aci Cisco ACI community affects_2.4 This issue/PR affects Ansible v2.4 c:module_utils/urls cisco Cisco technologies inventory Inventory category module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. networking Network category new_module This PR includes a new module. new_plugin This PR includes a new plugin. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet