Skip to content

CatalogService does not initialize region if regionless = true #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2014

Conversation

tmilos
Copy link
Contributor

@tmilos tmilos commented Apr 25, 2014

Regionless services, like DNS does not get initialized with region and fail on
Rackspace::dnsService
ServiceBuilder::factory
CatalogService::__construct
CatalogService::findEndpoint
CatalogItem::getEndpointFromRegion
line 139 with message
This service [cloudDNS] does not have access to the [] endpoint.

@tmilos tmilos changed the title CatalogService does not initialize region if regionless = true #343 CatalogService does not initialize region if regionless = true Apr 25, 2014
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling cc2fce4 on tmilos:RegionLessCatalogService into b28780d on rackspace:master.

@jamiehannaford
Copy link
Contributor

@tmilos For your PR, we always merge to the working branch - not master.

What version of PHP are you using? I'm using 5.5.11 and can't reproduce the error you're experiencing. All that happens on that line is that it assigns the $region as well as checking it's not NULL or FALSE. Moving the assignment operation to a new line doesn't change the way it works IMO.

@tmilos
Copy link
Contributor Author

tmilos commented Apr 25, 2014

I'm on 5.4.19. I'm not sure how it can work at yours. It's documented on http://php.net/manual/en/language.operators.logical.php as short-circuit

// foo() will never get called as those operators are short-circuit
$a = (false && foo());

@tmilos
Copy link
Contributor Author

tmilos commented Apr 26, 2014

I forgot to mention. I noticed this on v1.9.2. Haven't tried master, but looked at the code and it seems the same.

@jamiehannaford
Copy link
Contributor

@tmilos Since the DNS service is regionless, the first operator should always fail - meaning that the $region assignment should never happen. What I'm struggling to understand is why do you need to set the $region property for the DNS service?

@gecampbell
Copy link
Contributor

They launched a LON endpoint last week

Sent from my iPhone

On Apr 28, 2014, at 8:10 AM, "Jamie Hannaford" <notifications@github.commailto:notifications@github.com> wrote:

@tmiloshttps://github.com/tmilos Since the DNS service is regionless, the first operator should always fail - meaning that the $region assignment should never happen. What I'm struggling to understand is why do you need to set the $region property for the DNS service?


Reply to this email directly or view it on GitHubhttps://github.com//pull/344#issuecomment-41555751.

jamiehannaford pushed a commit that referenced this pull request Apr 28, 2014
CatalogService does not initialize region if regionless = true
@jamiehannaford jamiehannaford merged commit 8e5967b into rackspace:master Apr 28, 2014
@jamiehannaford
Copy link
Contributor

@tmilos Sorry for not realizing this. Although I tried authenticating against the LON region, it doesn't throw an exception if you provide US credentials. Only if you provide UK credentials. Thanks again for pointing this out.

@gecampbell
Copy link
Contributor

Yes, it’s still a global service, but they’re providing other endpoints for, presumably, better performance.

On Apr 28, 2014, at 9:01 AM, Jamie Hannaford <notifications@github.commailto:notifications@github.com> wrote:

@tmiloshttps://github.com/tmilos Sorry for not realizing this. Although I tried authenticating against the LON region, it doesn't throw an exception if you provide US credentials. Only if you provide UK credentials. Thanks again for pointing this out.


Reply to this email directly or view it on GitHubhttps://github.com//pull/344#issuecomment-41561196.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants