Example #1
0
 def __init__(self, hostname, username, password, timeout=60):
     self.hostname = hostname
     self.username = username
     self.password = password
     self.device = FortiOS(hostname,
                           username=username,
                           password=password,
                           timeout=timeout)
     self.config_replace = False
Example #2
0
    def setUpClass(cls):
        cls.device = FortiOS(config.vm_ip,
                             vdom='test_vdom',
                             username=config.username,
                             password=config.password)
        cls.device.open()

        with open(config.config_file_1, 'r') as f:
            cls.config_1 = f.readlines()
        with open(config.config_file_2, 'r') as f:
            cls.config_2 = f.readlines()
Example #3
0
 def __init__(self,
              hostname,
              username,
              password,
              timeout=60,
              optional_args=None):
     self.hostname = hostname
     self.username = username
     self.password = password
     self.device = FortiOS(
         hostname,
         username=username,
         password=password,
         timeout=timeout,
         vdom=optional_args['vdom'] if 'vdom' in optional_args else None)
     self.config_replace = False
Example #4
0
    def __init__(self,
                 hostname,
                 username,
                 password,
                 timeout=60,
                 optional_args=None):
        self.hostname = hostname
        self.username = username
        self.password = password

        if optional_args is not None:
            self.vdom = optional_args.get('fortios_vdom', None)
        else:
            self.vdom = None

        self.device = FortiOS(hostname,
                              username=username,
                              password=password,
                              timeout=timeout,
                              vdom=self.vdom)
        self.config_replace = False