Remove demo tenant/user and cleanup roles and make images uploaded by default public

This commit is contained in:
Joshua Harlow 2012-09-17 21:00:23 -07:00
parent 7b787bd970
commit 8847b2ddc0
4 changed files with 36 additions and 46 deletions

View File

@ -279,11 +279,16 @@ class Image(object):
self._check_name(kernel_image_name)
LOG.info('Adding kernel %s to glance.', colorizer.quote(kernel_image_name))
LOG.info("Please wait installing...")
args = {
'container_format': kernel['container_format'],
'disk_format': kernel['disk_format'],
'name': kernel_image_name,
'properties': {
'is_public': True,
},
}
with open(kernel['file_name'], 'r') as fh:
resource = self.client.images.create(data=fh,
container_format=kernel['container_format'],
disk_format=kernel['disk_format'],
name=kernel_image_name)
resource = self.client.images.create(data=fh, **args)
kernel_id = resource.id
# Upload the ramdisk, if we have one
@ -294,26 +299,34 @@ class Image(object):
self._check_name(ram_image_name)
LOG.info('Adding ramdisk %s to glance.', colorizer.quote(ram_image_name))
LOG.info("Please wait installing...")
args = {
'container_format': initrd['container_format'],
'disk_format': initrd['disk_format'],
'name': ram_image_name,
'properties': {
'is_public': True,
},
}
with open(initrd['file_name'], 'r') as fh:
resource = self.client.images.create(data=fh,
container_format=initrd['container_format'],
disk_format=initrd['disk_format'],
name=ram_image_name)
resource = self.client.images.create(data=fh, **args)
initrd_id = resource.id
# Upload the root, we must have one...
LOG.info('Adding image %s to glance.', colorizer.quote(image_name))
self._check_name(image_name)
args = dict()
args['name'] = image_name
args = {
'name': image_name,
'container_format': location['container_format'],
'disk_format': location['disk_format'],
'properties': {
'is_public': True,
},
}
if kernel_id or initrd_id:
args['properties'] = dict()
if kernel_id:
args['properties']['kernel_id'] = kernel_id
if initrd_id:
args['properties']['ramdisk_id'] = initrd_id
args['container_format'] = location['container_format']
args['disk_format'] = location['disk_format']
LOG.info("Please wait installing...")
with open(location['file_name'], 'r') as fh:
resource = self.client.images.create(data=fh, **args)

View File

@ -136,23 +136,19 @@ def get_shared_passwords(component):
mp = {}
mp['service_token'] = component.get_password("service_token")
mp['admin_password'] = component.get_password('admin_password')
mp['demo_password'] = component.get_password('demo_password')
mp['service_password'] = component.get_password('service_password')
return mp
def get_shared_params(ip, service_token, admin_password, demo_password, service_password,
def get_shared_params(ip, service_token, admin_password, service_password,
auth_host, auth_port, auth_proto, service_host, service_port, service_proto,
**kwargs):
mp = {}
# Tenants and users
mp['tenants'] = ['admin', 'service', 'demo']
mp['users'] = ['admin', 'demo']
mp['demo_tenant'] = 'demo'
mp['demo_user'] = 'demo'
mp['tenants'] = ['admin', 'service']
mp['users'] = ['admin']
mp['admin_tenant'] = 'admin'
mp['admin_user'] = 'admin'
@ -165,7 +161,6 @@ def get_shared_params(ip, service_token, admin_password, demo_password, service_
# Tokens and passwords
mp['service_token'] = service_token
mp['admin_password'] = admin_password
mp['demo_password'] = demo_password
mp['service_password'] = service_password
host_ip = ip

View File

@ -104,11 +104,6 @@ class KeystoneInstaller(comp.PythonInstallComponent):
to_set['OS_PASSWORD'] = params['admin_password']
to_set['OS_TENANT_NAME'] = params['admin_tenant']
to_set['OS_USERNAME'] = params['admin_user']
to_set['DEMO_OS_PASSWORD'] = params['demo_password']
to_set['DEMO_OS_TENANT_NAME'] = params['demo_tenant']
to_set['DEMO_OS_USERNAME'] = params['demo_user']
to_set['OS_AUTH_URL'] = params['endpoints']['public']['uri']
to_set['SERVICE_ENDPOINT'] = params['endpoints']['admin']['uri']
for (endpoint, details) in params['endpoints'].items():

View File

@ -46,7 +46,6 @@ endpoints:
region: RegionOne
roles:
- admin
- anotherrole
- KeystoneAdmin
- KeystoneServiceAdmin
# The Member role is used by Horizon and Swift so we need to keep it.
@ -83,32 +82,20 @@ services:
type: network
tenants:
- description: Admin tenant
name: admin
- description: Demo tenant
name: demo
name: '$keystone.admin_tenant'
- description: Service tenant
name: service
name: '$keystone.service_tenant'
users:
- email: demo@example.com
name: demo
password: '$keystone.demo_password'
roles:
- anotherrole:demo
- Member:demo
tenants:
- demo
- email: admin@example.com
name: admin
name: '$keystone.admin_user'
password: '$keystone.admin_password'
roles:
- admin:admin
- admin:demo
- KeystoneAdmin:admin
- KeystoneServiceAdmin:admin
- "${keystone.admin_user}:admin"
- "KeystoneAdmin:admin"
- "KeystoneServiceAdmin:admin"
tenants:
- admin
- "${keystone.admin_tenant}"
- service
- demo
- email: ec2@example.com
name: ec2
password: '$keystone.service_password'