Beispiel #1
0
 def test_generate_password(self):
     password = utils.generate_password(length=12)
     self.assertTrue([c for c in password if c in '0123456789'])
     self.assertTrue([c for c in password
                      if c in 'abcdefghijklmnopqrstuvwxyz'])
     self.assertTrue([c for c in password
                      if c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'])
Beispiel #2
0
 def test_generate_password(self):
     password = utils.generate_password(length=12)
     self.assertTrue([c for c in password if c in '0123456789'])
     self.assertTrue(
         [c for c in password if c in 'abcdefghijklmnopqrstuvwxyz'])
     self.assertTrue(
         [c for c in password if c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'])
Beispiel #3
0
 def _create_trustee_and_trust(osc, bay):
     password = utils.generate_password(length=18)
     trustee = osc.keystone().create_trustee(
         bay.uuid,
         password,
         CONF.trust.trustee_domain_id)
     bay.trustee_username = trustee.name
     bay.trustee_user_id = trustee.id
     bay.trustee_password = password
     trust = osc.keystone().create_trust(trustee.id)
     bay.trust_id = trust.id
Beispiel #4
0
def create_trustee_and_trust(osc, bay):
    try:
        password = utils.generate_password(length=18)
        trustee = osc.keystone().create_trustee(
            bay.uuid,
            password,
            CONF.trust.trustee_domain_id)
        bay.trustee_username = trustee.name
        bay.trustee_user_id = trustee.id
        bay.trustee_password = password
        trust = osc.keystone().create_trust(trustee.id)
        bay.trust_id = trust.id
    except Exception:
        LOG.exception(_LE('Failed to create trustee and trust for Bay: %s'),
                      bay.uuid)
        raise exception.TrusteeOrTrustToBayFailed(bay_uuid=bay.uuid)
Beispiel #5
0
def create_trustee_and_trust(osc, cluster):
    try:
        password = utils.generate_password(length=18)
        trustee = osc.keystone().create_trustee(
            cluster.uuid,
            password,
        )
        cluster.trustee_username = trustee.name
        cluster.trustee_user_id = trustee.id
        cluster.trustee_password = password
        trust = osc.keystone().create_trust(trustee.id)
        cluster.trust_id = trust.id
    except Exception:
        LOG.exception(
            _LE('Failed to create trustee and trust for Cluster: %s'),
            cluster.uuid)
        raise exception.TrusteeOrTrustToClusterFailed(
            cluster_uuid=cluster.uuid)