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

support load_replace_candidate function ,add implemented functions #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anas-shami
Copy link
Contributor

support load_replace_candidate function, add implemented functions to README file and add requirements (paramiko, SCPClient)

load_replace_candidate: load config remotely without running it on the switch.

@anas-shami
Copy link
Contributor Author

@samerd please review

Copy link
Collaborator

@samerd samerd left a comment

Choose a reason for hiding this comment

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

Thanks @anas-shami
missing unit-tests for the added commands

output = self._send_command(command)
bytes_free = '0'
matches = re.findall(r'Space Free\s+(\d+) MB', output)
if matches and len(matches) >= 2:
Copy link
Collaborator

Choose a reason for hiding this comment

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

not a good solution
what is a new fs added in the future or /config removed.
it would be better to use json and choose the one with the /var

Copy link
Contributor Author

@anas-shami anas-shami Oct 29, 2019

Choose a reason for hiding this comment

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

yes but even the json is not giving me any mapping, some thing like this

 {
        "Space Free": "7989 MB",
        "Space Used": "1889 MB",
        "Space Percent Free": "80%",
        "header": "Statistics for /var filesystem",
        "Space Available": "7481 MB",
        "Inodes Percent Free": "99%",
        "Space Total": "9878 MB"
    }

may I check the header attribute if this object.header contains ('/var') take free size

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