Fix for bug #766038
Chris Alfonso
calfonso at redhat.com
Fri Dec 9 21:44:02 UTC 2011
On 09/12/11 16:43 -0500, gblomqui at redhat.com wrote:
>From: Greg Blomquist <gblomqui at redhat.com>
>
>https://bugzilla.redhat.com/show_bug.cgi?id=766038
>
>Do a proper nil check before attempting to dereference the provider account on
>an instance while deleting config server configs for a deployment.
>---
> src/app/models/deployment.rb | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
>diff --git a/src/app/models/deployment.rb b/src/app/models/deployment.rb
>index a2aac0a..1a799b8 100644
>--- a/src/app/models/deployment.rb
>+++ b/src/app/models/deployment.rb
>@@ -460,8 +460,11 @@ class Deployment < ActiveRecord::Base
> # server used for all instances in the deployment
> # this logic could easily change
> if instances.any? {|instance| instance.user_data}
>- configserver = instances.first.provider_account.config_server
>- configserver.delete_deployment_config(uuid) if configserver
>+ # guard against the provider_account being nil
>+ if instances.first.provider_account
>+ configserver = instances.first.provider_account.config_server
>+ configserver.delete_deployment_config(uuid) if configserver
>+ end
> end
> end
>
>--
>1.7.7.4
>
Visiack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/aeolus-devel/attachments/20111209/f0894b38/attachment.sig>
More information about the aeolus-devel
mailing list