예제 #1
0
파일: handler.py 프로젝트: amaczuga/pyghmi
 def _megarac_attach_media(self, proto, username, password, imagename,
                           domain, path, host):
     # First we must ensure that the RIS is actually enabled
     self.ipmicmd.xraw_command(netfn=0x32, command=0x9f, data=(8, 10, 0, 1))
     if username is not None:
         self._set_ris_string(3, username)
     if password is not None:
         self._set_short_ris_string(4, password)
     if domain is not None:
         self._set_ris_string(6, domain)
     self._set_ris_string(1, path)
     ip = util.get_ipv4(host)[0]
     self._set_short_ris_string(2, ip)
     self._set_short_ris_string(5, proto)
     # now to restart RIS to have changes take effect...
     self.ipmicmd.xraw_command(netfn=0x32, command=0x9f, data=(8, 11))
     # now to kick off the requested mount
     self._megarac_media_waitforready(imagename)
     self._set_ris_string(0, imagename)
     self.ipmicmd.xraw_command(netfn=0x32, command=0xa0, data=(1, 1))
예제 #2
0
파일: handler.py 프로젝트: prostowww/pyghmi
 def _megarac_attach_media(self, proto, username, password, imagename,
                           domain, path, host):
     # First we must ensure that the RIS is actually enabled
     self.ipmicmd.xraw_command(netfn=0x32, command=0x9f, data=(8, 10, 0, 1))
     if username is not None:
         self._set_ris_string(3, username)
     if password is not None:
         self._set_short_ris_string(4, password)
     if domain is not None:
         self._set_ris_string(6, domain)
     self._set_ris_string(1, path)
     ip = util.get_ipv4(host)[0]
     self._set_short_ris_string(2, ip)
     self._set_short_ris_string(5, proto)
     # now to restart RIS to have changes take effect...
     self.ipmicmd.xraw_command(netfn=0x32, command=0x9f, data=(8, 11))
     # now to kick off the requested mount
     self._megarac_media_waitforready(imagename)
     self._set_ris_string(0, imagename)
     self.ipmicmd.xraw_command(netfn=0x32, command=0xa0,
                               data=(1, 1))