diff --git a/nova/api/ec2/cloud.py b/nova/api/ec2/cloud.py index 2ee8fa1572fc..156042833191 100644 --- a/nova/api/ec2/cloud.py +++ b/nova/api/ec2/cloud.py @@ -80,11 +80,11 @@ QUOTAS = quota.QUOTAS def validate_ec2_id(val): if not validator.validate_str()(val): - raise exception.InvalidInstanceIDMalformed(val) + raise exception.InvalidInstanceIDMalformed(val=val) try: ec2utils.ec2_id_to_id(val) except exception.InvalidEc2Id: - raise exception.InvalidInstanceIDMalformed(val) + raise exception.InvalidInstanceIDMalformed(val=val) # EC2 API can return the following values as documented in the EC2 API diff --git a/nova/compute/api.py b/nova/compute/api.py index cc02e4a82d2d..757f78f2d412 100644 --- a/nova/compute/api.py +++ b/nova/compute/api.py @@ -1496,7 +1496,8 @@ class API(base.Base): raise exception.InstanceInvalidState( attr='task_state', instance_uuid=instance['uuid'], - state=instance['task_state']) + state=instance['task_state'], + method='reboot') state = {'SOFT': task_states.REBOOTING, 'HARD': task_states.REBOOTING_HARD}[reboot_type] instance = self.update(context, instance, vm_state=vm_states.ACTIVE, @@ -1942,7 +1943,7 @@ class API(base.Base): def get_vnc_console(self, context, instance, console_type): """Get a url to an instance Console.""" if not instance['host']: - raise exception.InstanceNotReady(instance=instance) + raise exception.InstanceNotReady(instance_id=instance['uuid']) connect_info = self.compute_rpcapi.get_vnc_console(context, instance=instance, console_type=console_type) diff --git a/nova/crypto.py b/nova/crypto.py index 41e8e9869c19..b7caa1c6e960 100644 --- a/nova/crypto.py +++ b/nova/crypto.py @@ -99,7 +99,7 @@ def fetch_ca(project_id=None): project_id = None ca_file_path = ca_path(project_id) if not os.path.exists(ca_file_path): - raise exception.CryptoCAFileNotFound(project_id=project_id) + raise exception.CryptoCAFileNotFound(project=project_id) with open(ca_file_path, 'r') as cafile: return cafile.read() @@ -161,7 +161,7 @@ def fetch_crl(project_id): project_id = None crl_file_path = crl_path(project_id) if not os.path.exists(crl_file_path): - raise exception.CryptoCRLFileNotFound(project_id) + raise exception.CryptoCRLFileNotFound(project=project_id) with open(crl_file_path, 'r') as crlfile: return crlfile.read() diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index ec85ddcef65f..1638283e141f 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -997,9 +997,10 @@ def fixed_ip_associate(context, address, instance_uuid, network_id=None, # then this has concurrency issues if fixed_ip_ref is None: raise exception.FixedIpNotFoundForNetwork(address=address, - network_id=network_id) + network_uuid=network_id) if fixed_ip_ref.instance_uuid: - raise exception.FixedIpAlreadyInUse(address=address) + raise exception.FixedIpAlreadyInUse(address=address, + instance_uuid=instance_uuid) if not fixed_ip_ref.network_id: fixed_ip_ref.network_id = network_id @@ -1200,7 +1201,7 @@ def fixed_ip_get_by_network_host(context, network_id, host): first() if not result: - raise exception.FixedIpNotFoundForNetworkHost(network_id=network_id, + raise exception.FixedIpNotFoundForNetworkHost(network_uuid=network_id, host=host) return result diff --git a/nova/network/manager.py b/nova/network/manager.py index 1ba1370e0994..97d4fa10d341 100644 --- a/nova/network/manager.py +++ b/nova/network/manager.py @@ -1374,7 +1374,7 @@ class NetworkManager(manager.SchedulerDependentManager): self.deallocate_fixed_ip(context, address, host) return raise exception.FixedIpNotFoundForSpecificInstance( - instance_id=instance_id, ip=address) + instance_uuid=instance_id, ip=address) def _validate_instance_zone_for_dns_domain(self, context, instance): instance_zone = instance.get('availability_zone') diff --git a/nova/virt/fake.py b/nova/virt/fake.py index 77f600e22720..c9cd41680d64 100644 --- a/nova/virt/fake.py +++ b/nova/virt/fake.py @@ -124,7 +124,7 @@ class FakeDriver(driver.ComputeDriver): def snapshot(self, context, instance, name): if not instance['name'] in self.instances: - raise exception.InstanceNotRunning() + raise exception.InstanceNotRunning(instance_id=instance['uuid']) def reboot(self, instance, network_info, reboot_type, block_device_info=None): diff --git a/nova/virt/libvirt/driver.py b/nova/virt/libvirt/driver.py index 85ff91218d8b..dc1ab3936dcc 100644 --- a/nova/virt/libvirt/driver.py +++ b/nova/virt/libvirt/driver.py @@ -821,7 +821,7 @@ class LibvirtDriver(driver.ComputeDriver): try: virt_dom = self._lookup_by_name(instance['name']) except exception.InstanceNotFound: - raise exception.InstanceNotRunning() + raise exception.InstanceNotRunning(instance_id=instance['uuid']) (image_service, image_id) = glance.get_remote_image_service( context, instance['image_ref'])