示例#1
0
    def _build_proxy(self):
        """ Builds the XML-RPC proxy to MMC agent. """
        try:
            self._proxy = sync.Proxy(self._url)

        except Exception, err:
            logging.getLogger().error(
                "Error while connecting to mmc-agent : %s" % err)
            self._failure = True
示例#2
0
    def _build_proxy(self, password):
        """ Builds the XML-RPC proxy to MMC agent. """
        try:
            self._proxy = sync.Proxy(self._url)

            logging.getLogger().debug("LDAP authentification")
            self._proxy.base.ldapAuth('root', password)
            logging.getLogger().debug("Create a mmc-agent proxy")

        except Exception, err:
            logging.getLogger().error(
                "Error while connecting to mmc-agent : %s" % err)
            self._failure = True
示例#3
0
if "debug" in sys.argv:
    mode = "debug"
    Verbosity = 2
else:
    mode = "info"

if "makefile" in sys.argv:
    makefile = True

"""
Connect to the MMC agent using the MMCProxy class defined above
"""
login = '******'
password = '******'

client = sync.Proxy('https://%s:%s@localhost:7080'%(login, password), False)
client.base.ldapAuth('root', 'secret')

"""
Test class
"""

class class01inventoryInitTest(TestCase):
    """
    Tests classes of the inventory module
    """
    def setUp(self):
        self.client = client.inventory

    def test101inventoryExists(self):
        result = self.client.inventoryExists('34')