Skip to content

nxapi_utils password 'getter' #30

Description

@scotthereld

Below is the list of ‘getters’ in the NXAPI() class:

Test code will 'Succeed' with this Bug in place, as 'username' and 'password' are identical. The 'get_password()' method returns 'self.username' where 'self.password' is expected.

class NXAPI:
'''A better NX-API utility'''
def init(self):
self.target_url = 'http://localhost/ins'
self.username = 'admin'
self.password = ‘admin’
self.timeout = 10


def get_target_url(self):
return self.target_url

def get_username(self):
    return self.username

**def get_password(self):**
    **return self. username**

def get_timeout(self):
    return self.timeout

def get_cmd(self):
    return self.cmd

def get_out_format(self):
    return self.out_format

def get_do_chunk(self):
    return self.do_chunk

def get_sid(self):
    return self.sid

def get_cookie(self):
    return self.cookie

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions