Skip to content
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

Can't access self.service_url in ScienceBaseResource._get #2

Open
nikmolnar opened this issue Aug 28, 2021 · 0 comments
Open

Can't access self.service_url in ScienceBaseResource._get #2

nikmolnar opened this issue Aug 28, 2021 · 0 comments
Assignees

Comments

@nikmolnar
Copy link
Contributor

nikmolnar commented Aug 28, 2021

The ._get method of ScienceBase resource needs to access self.service_url in order to correctly generate (or not) an ArcGIS server token:

server_admin = ArcGISSecureResource.generate_token(self.service_url, arcgis_user, arcgis_pass)

However, due to circular resource loading logic, the service_url getter method returns ._url as a default because trying to load ._service_url results in an attribute error.

Likewise, trying to use ._service_url directly in in the ScienceBaseResource._get method causes an AttributeError and resource loading fails.

This issue can be observed in 1589ea8, which contains a shim to work around it. Without the extra call to self.service_url, it will end up using ._url to try generate an ArcGIS server token.

nikmolnar added a commit that referenced this issue Aug 28, 2021
Some SB datasets use an ArcGIS service hosted on a server other than `sciencebase.gov` and so tokens need to be generated based on the service URL and not the resource URL.

Note this fix contains a shim to work around issue #2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants