Пример #1
0
 def registerAsMaster(hostname,
                      username="******",
                      password="******",
                      port=8899,
                      isSsl=False):
     try:
         logger.debug(
             OvmHost.registerAsMaster,
             "ip=%s, username=%s, password=%s, port=%s, isSsl=%s" %
             (hostname, username, password, port, isSsl))
         exceptionIfNoSuccess(
             register_server(hostname, 'site', False, username, password,
                             port, isSsl),
             "Register %s as site failed" % hostname)
         exceptionIfNoSuccess(
             register_server(hostname, 'utility', False, username, password,
                             port, isSsl),
             "Register %s as utility failed" % hostname)
         rs = SUCC()
         return rs
     except Exception, e:
         errmsg = fmt_err_msg(e)
         logger.error(OvmHost.registerAsMaster, errmsg)
         raise XmlRpcFault(toErrCode(OvmHost, OvmHost.registerAsMaster),
                           errmsg)
Пример #2
0
 def registerAsMaster(hostname, username="******", password="******", port=8899, isSsl=False):
     try:
         logger.debug(OvmHost.registerAsMaster, "ip=%s, username=%s, password=%s, port=%s, isSsl=%s"%(hostname, username, password, port, isSsl))
         exceptionIfNoSuccess(register_server(hostname, 'site', False, username, password, port, isSsl),
                          "Register %s as site failed"%hostname)
         exceptionIfNoSuccess(register_server(hostname, 'utility', False, username, password, port, isSsl),
                          "Register %s as utility failed"%hostname)
         rs = SUCC()
         return rs
     except Exception, e:
         errmsg = fmt_err_msg(e)
         logger.error(OvmHost.registerAsMaster, errmsg)
         raise XmlRpcFault(toErrCode(OvmHost, OvmHost.registerAsMaster), errmsg)