-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
Refactoring code to adhere to persistence connection. #44398
Conversation
The test
The test
The test
|
@@ -183,6 +190,70 @@ | |||
from collections import defaultdict | |||
|
|||
|
|||
# Utility Method to rollback the running config or start up copnfig | |||
# This method supports only SCP or SFTP or FTP or TFTP | |||
def doConfigRollBack(module, prompt, answer): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears this code was originally (in it's refactored form) licensed as BSD. I believe you will need to either include license information for this function stating that this function is still BSD licensed, or get approval from the prior authors of the removed code indicated above, to relicense as GPLv3.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am the only author for the entire solutions for supporting CNOS and ENOS switches on behalf of Lenovo. There has been a review comment from community that the utility file is growing in size which is further affecting its maintainability. So it has been decided to move few util code to module file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please suggest me, what should I do in this regard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
David Kasberg has retired from Lenovo and is no more in world of coding. We are still very much in contact. Should I contact him for approval?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @gundalow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi Sivel,
Lenovo Legal team is suggesting to embed BSD License to the snippet that is getting moved from cnos.py. Once OSC team approves the sample code modification I have done, I will make necessary changes here for your approval. May be by Tuesday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@amuraleedhar That sounds good. Can you please get this PR updated do we can merge before community freeze on 30th?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The licensing issue aside, this looks fine as far as the refactor is concerned.
else: | ||
transfer_status = "Invalid Protocol option" | ||
output = '' | ||
if(protocol == "tftp" or protocol == "ftp" or |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you like, something like this can be redone as if protocol in ('tftp', 'ftp', 'sftp', 'scp'):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I will change that. I have requested for a mail from legal department. They are yet to respond. Will do this in meantime
Please review and merge it now.
Regards
-Anil
From: John R Barker <notifications@github.com>
Sent: Tuesday, August 28, 2018 7:13 PM
To: ansible/ansible <ansible@noreply.github.com>
Cc: Anil Kumar Muraleedharan <amuraleedhar@lenovo.com>; Mention <mention@noreply.github.com>
Subject: [External] Re: [ansible/ansible] Refactoring code to adhere to persistence connection. (#44398)
@gundalow commented on this pull request.
________________________________
In lib/ansible/modules/network/cnos/cnos_rollback.py<#44398 (comment)>:
@@ -183,6 +190,70 @@
from collections import defaultdict
+# Utility Method to rollback the running config or start up copnfig
+# This method supports only SCP or SFTP or FTP or TFTP
+def doConfigRollBack(module, prompt, answer):
@amuraleedhar<https://github.com/amuraleedhar> That sounds good. Can you please get this PR updated do we can merge before community freeze on 30th?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#44398 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ANdCcosHu2SQZVV5cByW42kDUhN9pOM6ks5uVUj0gaJpZM4WECIf>.
|
Included for posterity, here are the relevant bits of the response from Lenovo legal forwarded to me:
|
SUMMARY
In this PR I am moving the code which is in util file cnos.py to respective module code. There was a review comment is this regard that util file is of huge size. This is an effort to reduce the size.
ISSUE TYPE
COMPONENT NAME
lib\ansible\modules\network\cnos\cnos_rollback.py
lib\ansible\module_util\network\cnos\cnos.py
ANSIBLE VERSION
ansible 2.7.0.dev0 (devel f9cbdcd) last updated 2018/07/03 14:55:43 (GMT +550)
config file = /etc/ansible/ansible.cfg
configured module search path = [u'/root/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
ansible python module location = /home/ansible/sheru/ansible/lib/ansible
executable location = /home/ansible/sheru/ansible/bin/ansible
python version = 2.7.6 (default, Nov 23 2017, 15:49:48) [GCC 4.8.4]
ADDITIONAL INFORMATION
Unused code in cnos.py is removed. Tested with CNOS Mars switch for SFTP and SCP