Skip to content

method to get version details of a bigip#1387

Merged
caphrim007 merged 6 commits intoF5Networks:developmentfrom
Preyansh91:development
Feb 8, 2018
Merged

method to get version details of a bigip#1387
caphrim007 merged 6 commits intoF5Networks:developmentfrom
Preyansh91:development

Conversation

@Preyansh91
Copy link
Copy Markdown
Contributor

What issues does this address?

Fixes #1386
WIP #1386
...

What's this change do?

This change is to add support for getting version details of a bigip using f5-sdk. the icontrol rest /mgmt/tm/sys/version has version specific details and this change adds the code to get those details using f5-sdk.

Where should the reviewer start?

The reviewer can find a new file called version.py under f5/bigip/tm/sys/ and the tests for the same can be found in the corresponding unit and functional folders.

@caphrim007
Copy link
Copy Markdown
Contributor

@Preyansh91 you can find the errors in the f5-common-python slack team in the #github-events channel. I'm re-pasting here for convenience.

f5/bigip/tm/sys/test/functional/test_version.py::TestVersion::test_entry ERROR

==================================== ERRORS ====================================
_________________ ERROR at teardown of TestVersion.test_entry __________________

    def teardown():
>       v.entries = entries
E       NameError: free variable 'entries' referenced before assignment in enclosing scope

f5/bigip/tm/sys/test/functional/test_version.py:19: NameError
=================================== FAILURES ===================================
____________________________ TestVersion.test_entry ____________________________

self = <f5.bigip.tm.sys.test.functional.test_version.TestVersion object at 0x7f514ada7390>
request = <FixtureRequest for <Function 'test_entry'>>
mgmt_root = <f5.bigip.ManagementRoot object at 0x7f514b33b310>

    def test_entry(self, request, mgmt_root):
        # Load
>       ver1, orig_entries = setup_version_test(request, mgmt_root)

f5/bigip/tm/sys/test/functional/test_version.py:30: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
f5/bigip/tm/sys/test/functional/test_version.py:23: in setup_version_test
    entries = v.entries
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

container = <f5.bigip.tm.sys.version.Version object at 0x7f514ada7090>
name = 'entries'

    def __getattr__(container, name):
        # ensure this object supports lazy attrs.
        cls_name = container.__class__.__name__
        if 'allowed_lazy_attributes' not in container._meta_data:
            error_message = ('"allowed_lazy_attributes" not in',
                             'container._meta_data for class %s' % cls_name)
>           raise LazyAttributesRequired(error_message)
E           LazyAttributesRequired: ('"allowed_lazy_attributes" not in', 'container._meta_data for class Version')

f5/bigip/mixins.py:95: LazyAttributesRequired
!!!!!!!!!!!!!!!!!!!! Interrupted: stopping after 2 failures !!!!!!!!!!!!!!!!!!!!
========= 1 failed, 158 passed, 42 skipped, 1 error in 394.09 seconds ==========
ERROR: InvocationError: '/var/lib/jenkins/workspace/f5-sdk/ci.f5.f5-common-python/.tox/py27-bip-v11.5.4/bin/py.test --bigip localhost --port 10443 -s -vv --release 11.5.4 -x --port 11154 f5/bigip/tm/sys/test/functional f5/bigip/tm/sys/test/unit/test_version.py'
___________________________________ summary ____________________________________
ERROR:   py27-bip-v11.5.4: commands failed
Build step 'Execute shell' marked build as failure
Finished: FAILURE

@caphrim007
Copy link
Copy Markdown
Contributor

lgtm

@caphrim007 caphrim007 merged commit c569d1c into F5Networks:development Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants