コード例 #1
0
class JujuApiTest(unittest.TestCase):
    def setUp(self):
        self.c = JujuClient(url=JUJU_URL)
        self.c.login(JUJU_PASS)

    def tearDown(self):
        self.c.close()

    def test_info(self):
        ret = self.c.info()
        self.assertTrue(ret)
コード例 #2
0
#!/usr/bin/env python

import os
import sys
sys.path.insert(0, '../cloudinstall')
from cloudinstall.juju.client import JujuClient
from pprint import pprint
import json
import time

JUJU_PASS = os.environ['JUJU_PASS'] if os.environ['JUJU_PASS'] else randomString()
JUJU_URL = os.environ['JUJU_URL'] if os.environ['JUJU_URL'] else 'wss://juju-bootstrap.master:17070/'

if __name__ == '__main__':
    ws = JujuClient(JUJU_URL)
    ws.login(JUJU_PASS)
    ws.info()
    ws.close()