ktbyers / scp_sidecar

Ansible modules using SCP and SSH to transfer files to network devices
Apache License 2.0
24 stars 13 forks source link

show nvram: fails #11

Open ktbyers opened 8 years ago

ktbyers commented 8 years ago
def verify_space_available(self, search_pattern=r"(.*) bytes available "):
    '''
    Verify sufficient space is available on remote network device

    Return a boolean
    '''
    remote_cmd = "show {0}".format(self.file_system)
    remote_output = self.ssh_ctl_chan.send_command(remote_cmd)
    match = re.search(search_pattern, remote_output)
    space_avail = int(match.group(1))

    if space_avail > self.file_size:
        return True

    return False

Should probably change this to dir and not show