def _login(self, username='******', password='******', **kwargs): l = ScgJsonLogin() result, self.jsessionid = l.login(scg_mgmt_ip=self.scg_mgmt_ip, scg_port=self.scg_port, username=username, password=password) return result
def login_to_scg(self, **kwargs): self.sjl = ScgJsonLogin() res, jsessionid = self.sjl.login(**kwargs) if not res: raise Exception("Failed to Login to SCG") self.jsessionid = jsessionid return jsessionid
def login_to_scg( self, scg_mgmt_ip='127.0.0.2', scg_port='8443', username='******', password='******', ): """ API used to login to SCG. :param str scg_mgmt_ip: SCG Management IP :param str scg_port: SCG https port :param str username: username (admin or mvno user) :param str password: password (admin or mvno password) :return: jsessionid if login is successful else Exception :rtype: string Example: | Login to SCG | scg_mgmt_ip=172.19.18.150 | username=admin | password=ruckus | """ sjl = ScgJsonLogin() res, jsessionid = sjl.login(scg_mgmt_ip=scg_mgmt_ip, scg_port=scg_port, username=username, password=password) if not res: raise AssertionError("Failed to Login to SCG") self.set_scg_session(scg_mgmt_ip=scg_mgmt_ip, scg_port=scg_port, jsessionid=jsessionid) return jsessionid
class RWQATTGRobotScgJsonLoginKeywords(): def __init__(self): self.sjl = None self.jsessionid = None pass def login_to_scg(self, **kwargs): self.sjl = ScgJsonLogin() res, jsessionid = self.sjl.login(**kwargs) if not res: raise Exception("Failed to Login to SCG") self.jsessionid = jsessionid return jsessionid def get_jsessionid(self): return self.jsessionid