diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-02-10 00:39:50 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-02-10 00:39:50 +0000 |
| commit | ab568d4d457735a3a20fd1b926c2151da13f09f3 (patch) | |
| tree | 6a567d09da6f696669ae9379c950840bd1d2aa79 /nova/api | |
| parent | b8944efb1e2c87a9136f941eddaf90fc02b7fffb (diff) | |
| parent | 525ba40417256f6448c52939274ee2505fbc6b78 (diff) | |
Merge "Backslash continuations (misc.)"
Diffstat (limited to 'nova/api')
| -rw-r--r-- | nova/api/auth.py | 9 | ||||
| -rw-r--r-- | nova/api/ec2/cloud.py | 21 | ||||
| -rw-r--r-- | nova/api/metadata/handler.py | 3 |
3 files changed, 15 insertions, 18 deletions
diff --git a/nova/api/auth.py b/nova/api/auth.py index 316a8f72f..a1a375d7c 100644 --- a/nova/api/auth.py +++ b/nova/api/auth.py @@ -28,11 +28,10 @@ from nova.openstack.common import cfg from nova import wsgi -use_forwarded_for_opt = \ - cfg.BoolOpt('use_forwarded_for', - default=False, - help='Treat X-Forwarded-For as the canonical remote address. ' - 'Only enable this if you have a sanitizing proxy.') +use_forwarded_for_opt = cfg.BoolOpt('use_forwarded_for', + default=False, + help='Treat X-Forwarded-For as the canonical remote address. ' + 'Only enable this if you have a sanitizing proxy.') FLAGS = flags.FLAGS FLAGS.add_option(use_forwarded_for_opt) diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 29b804b4c..7a821699b 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -257,7 +257,7 @@ class CloudController(object): for host in hosts: rv['availabilityZoneInfo'].append({'zoneName': '|- %s' % host, 'zoneState': ''}) - hsvcs = [service for service in services \ + hsvcs = [service for service in services if service['host'] == host] for svc in hsvcs: alive = utils.service_is_up(svc) @@ -348,8 +348,7 @@ class CloudController(object): for key_pair in key_pairs: # filter out the vpn keys suffix = FLAGS.vpn_key_suffix - if context.is_admin or \ - not key_pair['name'].endswith(suffix): + if context.is_admin or not key_pair['name'].endswith(suffix): result.append({ 'keyName': key_pair['name'], 'keyFingerprint': key_pair['fingerprint'], @@ -513,10 +512,10 @@ class CloudController(object): source_project_id = self._get_source_project_id(context, source_security_group_owner_id) - source_security_group = \ - db.security_group_get_by_name(context.elevated(), - source_project_id, - source_security_group_name) + source_security_group = db.security_group_get_by_name( + context.elevated(), + source_project_id, + source_security_group_name) notfound = exception.SecurityGroupNotFound if not source_security_group: raise notfound(security_group_id=source_security_group_name) @@ -1389,8 +1388,8 @@ class CloudController(object): metadata = {'properties': {'image_location': image_location}} if 'root_device_name' in kwargs: - metadata['properties']['root_device_name'] = \ - kwargs.get('root_device_name') + metadata['properties']['root_device_name'] = kwargs.get( + 'root_device_name') mappings = [_parse_block_device_mapping(bdm) for bdm in kwargs.get('block_device_mapping', [])] @@ -1413,8 +1412,8 @@ class CloudController(object): result['launchPermission'].append({'group': 'all'}) def _root_device_name_attribute(image, result): - result['rootDeviceName'] = \ - block_device.properties_root_device_name(image['properties']) + _prop_root_dev_name = block_device.properties_root_device_name + result['rootDeviceName'] = _prop_root_dev_name(image['properties']) if result['rootDeviceName'] is None: result['rootDeviceName'] = block_device.DEFAULT_ROOT_DEV_NAME diff --git a/nova/api/metadata/handler.py b/nova/api/metadata/handler.py index 7cf5514a3..a6bab8c2a 100644 --- a/nova/api/metadata/handler.py +++ b/nova/api/metadata/handler.py @@ -100,8 +100,7 @@ class MetadataRequestHandler(wsgi.Application): mappings = {} mappings['ami'] = block_device.strip_dev(root_device_name) mappings['root'] = root_device_name - default_ephemeral_device = \ - instance_ref.get('default_ephemeral_device') + default_ephemeral_device = instance_ref.get('default_ephemeral_device') if default_ephemeral_device: mappings['ephemeral0'] = default_ephemeral_device default_swap_device = instance_ref.get('default_swap_device') |
