コード例 #1
0
ファイル: NetConfigDevice.py プロジェクト: pazdera/lnst
 def slave_add(self, slaveid):
     dev_name = self._netdev["name"]
     port_netdev = self._config[slaveid]
     port_name = port_netdev["name"]
     teamd_port_config = get_slave_option(self._netdev,
                                          slaveid, "teamd_port_config")
     dbus_option = "-D" if self._should_enable_dbus() else ""
     if teamd_port_config:
         teamd_port_config = prepare_json_str(teamd_port_config)
         exec_cmd("teamdctl %s %s port config update %s \"%s\"" % (dbus_option, dev_name, port_name, teamd_port_config))
     NetConfigDevice(port_netdev, self._config).down()
     exec_cmd("teamdctl %s %s port add %s" % (dbus_option, dev_name, port_name))
コード例 #2
0
 def _slave_add(self, slave_id):
     dev_name = self._dev_config["name"]
     port_dev = self._if_manager.get_mapped_device(slave_id)
     port_name = port_dev.get_name()
     teamd_port_config = get_slave_option(self._dev_config,
                                          slave_id,
                                          "teamd_port_config")
     dbus_option = "-D" if self._should_enable_dbus() else ""
     if teamd_port_config:
         teamd_port_config = prepare_json_str(teamd_port_config)
         exec_cmd("teamdctl %s %s port config update %s \"%s\"" % (dbus_option, dev_name, port_name, teamd_port_config))
     port_dev.down()
     exec_cmd("teamdctl %s %s port add %s" % (dbus_option, dev_name, port_name))
コード例 #3
0
 def _slave_add(self, slave_id):
     dev_name = self._dev_config["name"]
     port_dev = self._if_manager.get_mapped_device(slave_id)
     port_name = port_dev.get_name()
     teamd_port_config = get_slave_option(self._dev_config,
                                          slave_id,
                                          "teamd_port_config")
     dbus_option = "-D" if self._should_enable_dbus() else ""
     if teamd_port_config:
         teamd_port_config = prepare_json_str(teamd_port_config)
         exec_cmd("teamdctl %s %s port config update %s \"%s\"" % (dbus_option, dev_name, port_name, teamd_port_config))
     port_dev.down()
     exec_cmd("teamdctl %s %s port add %s" % (dbus_option, dev_name, port_name))
コード例 #4
0
ファイル: NetConfigDevice.py プロジェクト: pazdera/lnst
 def slave_add(self, slaveid):
     dev_name = self._netdev["name"]
     port_netdev = self._config[slaveid]
     port_name = port_netdev["name"]
     teamd_port_config = get_slave_option(self._netdev, slaveid,
                                          "teamd_port_config")
     dbus_option = "-D" if self._should_enable_dbus() else ""
     if teamd_port_config:
         teamd_port_config = prepare_json_str(teamd_port_config)
         exec_cmd("teamdctl %s %s port config update %s \"%s\"" %
                  (dbus_option, dev_name, port_name, teamd_port_config))
     NetConfigDevice(port_netdev, self._config).down()
     exec_cmd("teamdctl %s %s port add %s" %
              (dbus_option, dev_name, port_name))
コード例 #5
0
ファイル: NmConfigDevice.py プロジェクト: jpirko/lnst
    def _add_slaves(self):
        for slave_id in get_slaves(self._dev_config):
            slave_dev = self._if_manager.get_mapped_device(slave_id)
            slave_config = slave_dev.get_configuration()

            teamd_port_config = get_slave_option(self._dev_config, slave_id, "teamd_port_config")

            slave_con = dbus.Dictionary()

            if teamd_port_config != None:
                s_port_cfg = dbus.Dictionary({"config": teamd_port_config})
                slave_con["team-port"] = s_port_cfg

            slave_config.nm_enslave("team", self._dev_config["master_uuid"], slave_con)
コード例 #6
0
    def _add_slaves(self):
        for slave_id in get_slaves(self._dev_config):
            slave_dev = self._if_manager.get_mapped_device(slave_id)
            slave_config = slave_dev.get_configuration()

            teamd_port_config = get_slave_option(self._dev_config, slave_id,
                                                 "teamd_port_config")

            slave_con = dbus.Dictionary()

            if teamd_port_config != None:
                s_port_cfg = dbus.Dictionary({'config': teamd_port_config})
                slave_con['team-port'] = s_port_cfg

            slave_config.nm_enslave("team", self._dev_config["master_uuid"],
                                    slave_con)