Hi Venkat,
I came across the same issue and used a similar approach to make it work
:)
Thanks for sharing
Στις 02.10.2014 21:45, Venkatanathan Varadarajan έγραψε:
> Hi all,
>
> This is more of a feature that is not supported than a bug(?).
>
> Currently, authentication tokens are cached in a single file by default
> (~/.gce_libcloud_auth -- not platform independent) and when the user
> tries to manage compute instances across multiple GCE projects the
> GCEConnection tries to reuse the cached information even if the project
> requested is different.
>
> Although the credential_file kwarg could be used to set the file path,
> currently the parent connection class is not written to pass the
> parameter to the GoogleBaseConnection class.
>
> I was able to do a quick fix to support the use of multiple project with
> auth-token caching by doing this (although this assumes that there is
> only one service/app account that is used per project, one might need to
> change "self.project" to the service account email-id):
>
> def _ex_connection_class_kwargs(self):
> return {'auth_type': self.auth_type,
> 'project': self.project,
> 'scopes': self.scopes,
> + 'credential_file': '~/.gce_libcloud_' + self.project
> }
>
> I am not working it off the git repo, so I am not able to create a clean
> patch.
>
> $ diff apache-libcloud-0.15.1/libcloud/compute/drivers/gce.py{,.old}
> 2526,2527c2526
> < 'scopes': self.scopes,
> < 'credential_file': '~/.gce_libcloud_' + self.project}
> ---
>
>> 'scopes': self.scopes}
>
> I am not sure if anyone came across this issue. Hope this helps.
>
> -Venkat