Ejemplo n.º 1
0
 def __init__(self, name, cfg=None, authz=None):
     if cfg is None:
         self._cfg = build_cfg()
     else:
         self._cfg = cfg
     self._system = self._cfg.get_system()
     self.name = name
     self.ns = u"http://autoscaling.amazonaws.com/doc/2009-05-15/"
     self.xamznRequestId = str(uuid.uuid4())
     self._authz = self._cfg.get_authz()
Ejemplo n.º 2
0
 def __init__(self, name, cfg=None, authz=None):
     if cfg is None:
         self._cfg = build_cfg()
     else:
         self._cfg = cfg
     self._system = self._cfg.get_system()
     self.name = name
     self.ns = u"http://autoscaling.amazonaws.com/doc/2009-05-15/"
     self.xamznRequestId = str(uuid.uuid4())
     self._authz = self._cfg.get_authz()
Ejemplo n.º 3
0
def main():

    if len(sys.argv) != 5:
        print "usage: add_mysql_user <username> <key> <secret> <path to conf>"
        sys.exit(1)
    username = sys.argv[1]
    access_key = sys.argv[2]
    access_secret = sys.argv[3]
    os.environ['PHANTOM_CONFIG'] = sys.argv[4]

    cfg = build_cfg()
    authz = cfg.get_authz()

    authz.add_user(username, access_key, access_secret)
Ejemplo n.º 4
0
def main():

    if len(sys.argv) != 4:
        print "usage: add_users <user pattern> <nimbus home> <phantom conf file>"
        sys.exit(1)
    userpattern=sys.argv[1]
    nh=sys.argv[2]
    os.environ['PHANTOM_CONFIG'] = sys.argv[3]

    user_pw_list = get_fg_users(userpattern, nh)
    cfg = build_cfg()
    authz = cfg.get_authz()

    dashi_con = get_dashi_client(cfg._CFG)
    dtrs_client = DTRSClient(dashi_con)

    for (name, access_key, access_secret) in user_pw_list:
        print "handling user %s" % (name)
        (email, ssh_key) = get_user_public_key(name)
        add_one_user(authz, dtrs_client, access_key, access_secret, ssh_key, email, name)
Ejemplo n.º 5
0
def main():

    if len(sys.argv) != 4:
        print "usage: add_users <user pattern> <nimbus home> <phantom conf file>"
        sys.exit(1)
    userpattern = sys.argv[1]
    nh = sys.argv[2]
    os.environ['PHANTOM_CONFIG'] = sys.argv[3]

    user_pw_list = get_fg_users(userpattern, nh)
    cfg = build_cfg()
    authz = cfg.get_authz()

    dashi_con = get_dashi_client(cfg._CFG)
    dtrs_client = DTRSClient(dashi_con)

    for (name, access_key, access_secret) in user_pw_list:
        print "handling user %s" % (name)
        (email, ssh_key) = get_user_public_key(name)
        add_one_user(authz, dtrs_client, access_key, access_secret, ssh_key,
                     email, name)