[rhinstaller/blivet/pulls/200 rhel7-branch] fcoe: replace fipvlan with fcoemon (#1085325)

vpodzime installerbot-noreply at redhat.com
Tue Aug 11 12:46:46 UTC 2015


> @@ -110,27 +111,69 @@ def addSan(self, nic, dcb=False, auto_vlan=True):
>          log.info("Activating FCoE SAN attached to %s, dcb: %s autovlan: %s",
>                   nic, dcb, auto_vlan)
>  
> -        util.run_program(["ip", "link", "set", nic, "up"])
> -
>          rc = 0
> +        out = ""
> +        timeout = 60
>          error_msg = ""
>          if dcb:
> +
>              self._startLldpad()
> -            util.run_program(["dcbtool", "sc", nic, "dcb", "on"])
> -            util.run_program(["dcbtool", "sc", nic, "app:fcoe",
> -                                                "e:1", "a:1", "w:1"])
> -            rc, out = util.run_program_and_capture_output(["fipvlan", "-c", "-s", "-f",
> -                                               "-fcoe", nic])
> +            while timeout > 0:
> +                rc, out = util.run_program_and_capture_output(
> +                    ["lldptool", "-p"])
> +                if not rc:
> +                    break
> +                log.info("Waiting for lldpad to be ready")
> +                timeout -= 1
> +                time.sleep(1)
> +
> +            while timeout > 0:
> +                rc, out = util.run_program_and_capture_output(
> +                    ["dcbtool", "sc", nic, "dcb", "on"])
> +                if not rc:
> +                    break
> +                log.info("Retrying to turn dcb on")
> +                timeout -= 1
> +                time.sleep(1)
> +
> +            while timeout > 0:
> +                rc, out = util.run_program_and_capture_output(
> +                    ["dcbtool", "sc", nic, "pfc", "e:1", "a:1", "w:1"])
> +                if not rc:
> +                    break
> +                log.info("Retrying to set up dcb with pfc")
> +                timeout -= 1
> +                time.sleep(1)
> +
> +            while timeout > 0:
> +                rc, out = util.run_program_and_capture_output(
> +                    ["dcbtool", "sc", nic, "app:fcoe", "e:1", "a:1", "w:1"])
> +                if not rc:
> +                    break
> +                time.sleep(1)
> +                log.info("Retrying to set up dcb for fcoe")
> +
> +            time.sleep(1)
> +
> +            if not rc:
> +                self.write_nic_fcoe_cfg(nic, dcb=dcb, auto_vlan=auto_vlan)
> +                rc, out = util.run_program_and_capture_output(
> +                    ["systemctl", "restart", "fcoe.service"])
> +
>          else:
> -            if auto_vlan:
> -                # certain network configrations require the VLAN layer module:
> +            dpath = os.readlink("/sys/class/net/%s/device/driver" % nic)
> +            driver = os.path.basename(dpath)
> +            if driver == "bnx2x":
> +                util.run_program(["ip", "link", "set", nic, "up"])
>                  util.run_program(["modprobe", "8021q"])
> -                rc, out = util.run_program_and_capture_output(["fipvlan", '-c', '-s', '-f',
> -                                                   "-fcoe",  nic])
> +                udev.settle()
> +                time.sleep(3)

Is this sleep really needed? And if so, are 3 seconds always going to be enough? I think we at least need some comment here.

-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/200#discussion_r36740041


More information about the anaconda-patches mailing list