• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python rpcServer.getServer函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中up2date_client.rpcServer.getServer函数的典型用法代码示例。如果您正苦于以下问题:Python getServer函数的具体用法?Python getServer怎么用?Python getServer使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getServer函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: testDefaultWelcomeMessageHttpToHttpCheckReturnCode

 def testDefaultWelcomeMessageHttpToHttpCheckReturnCode(self):
     "Test redirecting http to http and verify its return code"
     self.cfg['serverURL'] = "http://SECRET_URL/XMLRPC-REDIRECT-NOSSL"
     s = rpcServer.getServer()
     s.registration.welcome_message()
     status = s.get_response_status()
     self.assertEqual(status, 200)
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:7,代码来源:testRpcServer.py


示例2: testGetServerRedirectServer

 def testGetServerRedirectServer(self):
     "Verify that getServer works when talking to a server that redirects"
     self.cfg['serverURL'] = "%s-REDIRECT" % self.cfg['serverURL']
     try:
         s = rpcServer.getServer()
     except:
         self.fail("Got an expection calling rpcServer.getServer")
开发者ID:m47ik,项目名称:uyuni,代码行数:7,代码来源:testRpcServer.py


示例3: testGetServerRedirectServer

 def testGetServerRedirectServer(self):
     "Verify that getServer works when talking to a server that redirects"
     self.cfg['serverURL'] = "https://rhn.redhat.com/XMLRPC-REDIRECT"
     try:
         s = rpcServer.getServer()
     except:
         self.fail("Got an expection calling rpcServer.getServer")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:7,代码来源:testRpcServer.py


示例4: testDefaulWelcomeMessageNoRedirectCheckRedirect

 def testDefaulWelcomeMessageNoRedirectCheckRedirect(self):
     "Test a non redirecting connection and see if redirected() is set"
     self.cfg['serverURL'] = "http://SECRET_URL/XMLRPC"
     s = rpcServer.getServer()
     s.registration.welcome_message()
     ret = s.redirected()
     self.assertEqual(ret, None)
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:7,代码来源:testRpcServer.py


示例5: testDefaultWelcomeMessageHttpToHttpsCheckRedirect

 def testDefaultWelcomeMessageHttpToHttpsCheckRedirect(self):
     "Test redirecting http to https and verify redirect()"
     self.cfg['serverURL'] = "%s/XMLRPC-REDIRECT" % self.defaultServer
     s = rpcServer.getServer()
     s.registration.welcome_message()
     ret = s.redirected()
     self.assertEqual(ret, "%s/XMLRPC") % self.defaultServer
开发者ID:m47ik,项目名称:uyuni,代码行数:7,代码来源:testRpcServer.py


示例6: testDefaultWelcomeMessageHttpsToHttpsCheckReturnCode

 def testDefaultWelcomeMessageHttpsToHttpsCheckReturnCode(self):
     "Test redirecting https to https and verify its return code"
     self.cfg['serverURL'] = "%s/XMLRPC-REDIRECT" % self.defaultServer
     s = rpcServer.getServer()
     s.registration.welcome_message()
     status  = s.get_response_status()
     self.assertEqual(status, 200)
开发者ID:m47ik,项目名称:uyuni,代码行数:7,代码来源:testRpcServer.py


示例7: __init__

 def __init__(self, serverOverride=None, timeout=None, rpcServerOverride=None):
     if rpcServerOverride is None:
         self._server = rpcServer.getServer(serverOverride=serverOverride,
                 timeout=timeout)
     else:
         self._server = rpcServerOverride
     self._capabilities = None
开发者ID:Bearlock,项目名称:spacewalk,代码行数:7,代码来源:rhnserver.py


示例8: testDefaultWelcomeMessageHttpToHttpCheckRedirect

 def testDefaultWelcomeMessageHttpToHttpCheckRedirect(self):
     "Test redirecting http to http and verify redirect()"
     self.cfg['serverURL'] = "http://SECRET_URL/XMLRPC-REDIRECT-NOSSL"
     s = rpcServer.getServer()
     s.registration.welcome_message()
     ret = s.redirected()
     self.assertEqual(ret, "http://SECRET_URL/XMLRPC")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:7,代码来源:testRpcServer.py


示例9: updateHardware

def updateHardware():
    s = rpcServer.getServer()


    hardwareList = hardware.Hardware()
    s.registration.refresh_hw_profile(up2dateAuth.getSystemId(),
                                          hardwareList)
开发者ID:Bearlock,项目名称:spacewalk,代码行数:7,代码来源:rhnHardware.py


示例10: testGetServerMultipleCaCert

    def testGetServerMultipleCaCert(self):
        "getServer with a multiple CA certs"
        rpcServer.rhns_ca_certs = ["/usr/share/rhn/RHNS-CA-CERT", "/usr/share/rhn/RHNS-CA-CERT"]

        try:
            s = rpcServer.getServer()
        except:
            self.fail("Got an %s expection" % sys.exc_type)
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:8,代码来源:testRpcServer.py


示例11: testGetServerAuthProxyNoEnableAuthProxy

 def testGetServerAuthProxyNoEnableAuthProxy(self):
     "getServer with httpProxy set, but no enableAuthProxy"
     sys.path.append("/etc/sysconfig/rhn/")
     proxyUrl = testConfig.authProxyUrl
     self.cfg['httpProxy'] = testConfig.authProxyUrl
     try:
         s = rpcServer.getServer()
     except:
         self.fail("Got an expection calling rpcServer.getServer")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:9,代码来源:testRpcServer.py


示例12: testGetServerProxy

 def testGetServerProxy(self):
     "Verify that getServer Works when specifying a proxy"
     sys.path.append("/etc/sysconfig/rhn/")
     proxyUrl = testConfig.anonProxyUrl
     self.cfg['httpProxy'] = proxyUrl
     try:
         s = rpcServer.getServer()
     except:
         self.fail("Got an expection calling rpcServer.getServer")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:9,代码来源:testRpcServer.py


示例13: testDefaultWelcomeMessageHttpsToHttp

 def testDefaultWelcomeMessageHttpsToHttp(self):
     "Test redirecting https to http"
     self.cfg['serverURL'] = "https://SECRET_URL/XMLRPC-REDIRECT-NOSSL"
     s = rpcServer.getServer()
     try:
         s.registration.welcome_message()
     except rpclib.InvalidRedirectionError:
         pass
     else:
         self.fail("IOError expected here but didnt get it")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:10,代码来源:testRpcServer.py


示例14: testGetServerNoCaCert

 def testGetServerNoCaCert(self):
     "getServer with a missing CA cert"
     self.cfg['sslCACert'] =  ["/var/not/likely/to/exist/I/hope/SSL-CA-Cert"]
     try:
         s = rpcServer.getServer()
         write(s)
     except SystemExit:
         pass
     else:
         self.fail("Expected to get an SSLCertificateFileNotFound error")
开发者ID:m47ik,项目名称:uyuni,代码行数:10,代码来源:testRpcServer.py


示例15: testGetServerAuthProxyNoUsername

 def testGetServerAuthProxyNoUsername(self):
     "Verify that getSerer works when specifying an an auth proxy and no username"
     sys.path.append("/etc/sysconfig/rhn/")
     proxyUrl = testConfig.authProxyUrl
     self.cfg['httpProxy'] = testConfig.authProxyUrl
     self.cfg['enableAuthProxy'] = 1
     try:
         s = rpcServer.getServer()
     except:
         self.fail("Got an expection calling rpcServer.getServer")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:10,代码来源:testRpcServer.py


示例16: testDefaultWelcomeMessageHttpToHttpRedirectsOff

 def testDefaultWelcomeMessageHttpToHttpRedirectsOff(self):
     "Test redirecting http to http and verify if tails with allow_redirect off"
     self.cfg['serverURL'] = "http://SECRET_URL/XMLRPC-REDIRECT-NOSSL"
     s = rpcServer.getServer()
     s.allow_redirect(0)
     try:
         s.registration.welcome_message()
     except rpclib.InvalidRedirectionError:
         pass
     else:
         self.fail("InvalidRedirectionError expected here but didnt get it")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:11,代码来源:testRpcServer.py


示例17: testDefaultWelcomeMessageHttpsToHttpsRedirectsOff

 def testDefaultWelcomeMessageHttpsToHttpsRedirectsOff(self):
     "Test redirecting https to https and verify it fails with allow_redirect off"
     self.cfg['serverURL'] = "%s/XMLRPC-REDIRECT" % self.defaultServer
     s = rpcServer.getServer()
     s.allow_redirect(0)
     try:
         s.registration.welcome_message()
     except  rpclib.InvalidRedirectionError:
         pass
     else:
         self.fail("InvalidRedirectionError expected here but didnt get it")
开发者ID:m47ik,项目名称:uyuni,代码行数:11,代码来源:testRpcServer.py


示例18: testGetServerNoCaCert

    def testGetServerNoCaCert(self):
        "getServer with a missing CA cert"
        self.cfg['sslCACert'] =  ["/var/not/likely/to/exist/I/hope/SSL-CA-Cert"]
#        rpcServer.rhns_ca_certs = ["/var/not/likely/to/exist/I/hope/SSL-CA-Cert"]
        try:
            s = rpcServer.getServer()
            write(s)
        except SystemExit:
            pass
        else:
            self.fail("Expected to get a sys.exit(1)")
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:11,代码来源:testRpcServer.py


示例19: __get_server

    def __get_server():
        """ Initialize a server connection and set up capability info. """
        server = rpcServer.getServer()

        # load the new client caps if they exist
        clientCaps.loadLocalCaps()

        headerlist = clientCaps.caps.headerFormat()
        for (headerName, value) in headerlist:
            server.add_header(headerName, value)

        return server
开发者ID:BlackSmith,项目名称:spacewalk,代码行数:12,代码来源:rhn_check.py


示例20: getSolutions

 def getSolutions(self, unknowns, progressCallback = None, msgCallback = None):
     s = rpcServer.getServer(refreshCallback=self.refreshCallback)
     try:
         tmpRetList = rpcServer.doCall(s.up2date.solveDependencies,
                                         up2dateAuth.getSystemId(),
                                         unknowns)
     except rpclib.Fault, f:
         if f.faultCode == -26:
             #raise RpmError(f.faultString + _(", depended on by %s") % unknowns)
             raise up2dateErrors.RpmError(f.faultString)
         else:
              raise up2dateErrors.CommunicationError(f.faultString)
开发者ID:ChrisPortman,项目名称:mrepo,代码行数:12,代码来源:up2dateRepo.py



注:本文中的up2date_client.rpcServer.getServer函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python up2dateAuth.getSystemId函数代码示例发布时间:2022-05-27
下一篇:
Python config.initUp2dateConfig函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap