Support multiple exports in Globus XRootD plugin#153
Open
whwjiang wants to merge 1 commit into
Open
Conversation
| bool saw_blocks = false; | ||
| bool in_block = false; | ||
| GlobusRouteConfig default_route; | ||
| std::shared_ptr<GlobusRouteConfig> route(new GlobusRouteConfig(default_route)); |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| std::shared_ptr<GlobusRouteConfig> route(new GlobusRouteConfig(default_route)); | |
| std::shared_ptr<GlobusRouteConfig> route( | |
| new GlobusRouteConfig(default_route)); |
|
|
||
| if (!strcmp(attribute.c_str(), "globus.begin")) { | ||
| if (in_block) { | ||
| m_log.Emsg("Config", "Nested globus.begin blocks are not allowed"); |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| m_log.Emsg("Config", "Nested globus.begin blocks are not allowed"); | |
| m_log.Emsg("Config", | |
| "Nested globus.begin blocks are not allowed"); |
| } | ||
| if (!strcmp(attribute.c_str(), "globus.end")) { | ||
| if (!in_block) { | ||
| m_log.Emsg("Config", "Encountered globus.end without matching begin"); |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| m_log.Emsg("Config", "Encountered globus.end without matching begin"); | |
| m_log.Emsg("Config", | |
| "Encountered globus.end without matching begin"); |
| } | ||
| if (route->storage_prefix.empty() || route->endpoint_path.empty() || | ||
| route->transfer_url.empty()) { | ||
| m_log.Emsg("Config", "globus route is missing one or more required settings"); |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| m_log.Emsg("Config", "globus route is missing one or more required settings"); | |
| m_log.Emsg( | |
| "Config", | |
| "globus route is missing one or more required settings"); |
| m_transfer_token = TokenFile(transfer_token_file, &m_log); | ||
| if (!saw_blocks) { | ||
| auto final_route = std::make_shared<GlobusRouteConfig>(default_route); | ||
| if (final_route->storage_prefix.empty() || final_route->endpoint_path.empty() || |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| if (final_route->storage_prefix.empty() || final_route->endpoint_path.empty() || | |
| if (final_route->storage_prefix.empty() || | |
| final_route->endpoint_path.empty() || |
|
|
||
| #include "../src/HTTPCommands.hh" | ||
| #include "../src/HTTPFileSystem.hh" | ||
| #include "../src/GlobusFileSystem.hh" |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| #include "../src/GlobusFileSystem.hh" |
| #include <algorithm> | ||
| #include <csignal> | ||
| #include <cstring> | ||
| #include <filesystem> |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| #include <filesystem> |
| #include <cstring> | ||
| #include <filesystem> | ||
| #include <fcntl.h> | ||
| #include <fstream> |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| #include <fstream> | |
| #include <filesystem> | |
| #include <fstream> |
Comment on lines
+99
to
+107
| const auto cfgPath = writeTempConfig( | ||
| "httpserver.begin\n" | ||
| "httpserver.url_base https://root.example\n" | ||
| "httpserver.storage_prefix /\n" | ||
| "httpserver.end\n" | ||
| "httpserver.begin\n" | ||
| "httpserver.url_base https://foo.example\n" | ||
| "httpserver.storage_prefix /foo\n" | ||
| "httpserver.end\n"); |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| const auto cfgPath = writeTempConfig( | |
| "httpserver.begin\n" | |
| "httpserver.url_base https://root.example\n" | |
| "httpserver.storage_prefix /\n" | |
| "httpserver.end\n" | |
| "httpserver.begin\n" | |
| "httpserver.url_base https://foo.example\n" | |
| "httpserver.storage_prefix /foo\n" | |
| "httpserver.end\n"); | |
| const auto cfgPath = | |
| writeTempConfig("httpserver.begin\n" | |
| "httpserver.url_base https://root.example\n" | |
| "httpserver.storage_prefix /\n" | |
| "httpserver.end\n" | |
| "httpserver.begin\n" | |
| "httpserver.url_base https://foo.example\n" | |
| "httpserver.storage_prefix /foo\n" | |
| "httpserver.end\n"); |
Comment on lines
+133
to
+144
| const auto cfgPath = writeTempConfig( | ||
| "httpserver.trace debug\n" | ||
| "httpserver.token_file /tmp/shared.token\n" | ||
| "httpserver.remote_flavor webdav\n" | ||
| "httpserver.begin\n" | ||
| "httpserver.url_base https://root.example\n" | ||
| "httpserver.storage_prefix /\n" | ||
| "httpserver.end\n" | ||
| "httpserver.begin\n" | ||
| "httpserver.url_base https://foo.example\n" | ||
| "httpserver.storage_prefix /foo\n" | ||
| "httpserver.end\n"); |
Contributor
There was a problem hiding this comment.
[lint] reported by reviewdog 🐶
Suggested change
| const auto cfgPath = writeTempConfig( | |
| "httpserver.trace debug\n" | |
| "httpserver.token_file /tmp/shared.token\n" | |
| "httpserver.remote_flavor webdav\n" | |
| "httpserver.begin\n" | |
| "httpserver.url_base https://root.example\n" | |
| "httpserver.storage_prefix /\n" | |
| "httpserver.end\n" | |
| "httpserver.begin\n" | |
| "httpserver.url_base https://foo.example\n" | |
| "httpserver.storage_prefix /foo\n" | |
| "httpserver.end\n"); | |
| const auto cfgPath = | |
| writeTempConfig("httpserver.trace debug\n" | |
| "httpserver.token_file /tmp/shared.token\n" | |
| "httpserver.remote_flavor webdav\n" | |
| "httpserver.begin\n" | |
| "httpserver.url_base https://root.example\n" | |
| "httpserver.storage_prefix /\n" | |
| "httpserver.end\n" | |
| "httpserver.begin\n" | |
| "httpserver.url_base https://foo.example\n" | |
| "httpserver.storage_prefix /foo\n" | |
| "httpserver.end\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is the XRootD side changes necessary to support multiple Globus exports. In particular, it allows multiple exports to be defined in the XRootD config.
These changes rely on this PR to actually do the work of generating the XRootD config, though it could technically be tested in isolation.