Skip to content
Snippets Groups Projects
Unverified Commit cee426cc authored by Eelco Dolstra's avatar Eelco Dolstra Committed by GitHub
Browse files

Merge pull request #4938 from tomcur/store-uri-parsing

Improve machine store URI parsing
parents 24bc9354 e3d11f9a
No related branches found
No related tags found
No related merge requests found
...@@ -16,13 +16,18 @@ Machine::Machine(decltype(storeUri) storeUri, ...@@ -16,13 +16,18 @@ Machine::Machine(decltype(storeUri) storeUri,
decltype(mandatoryFeatures) mandatoryFeatures, decltype(mandatoryFeatures) mandatoryFeatures,
decltype(sshPublicHostKey) sshPublicHostKey) : decltype(sshPublicHostKey) sshPublicHostKey) :
storeUri( storeUri(
// Backwards compatibility: if the URI is a hostname, // Backwards compatibility: if the URI is schemeless, is not a path,
// prepend ssh://. // and is not one of the special store connection words, prepend
// ssh://.
storeUri.find("://") != std::string::npos storeUri.find("://") != std::string::npos
|| hasPrefix(storeUri, "local") || storeUri.find("/") != std::string::npos
|| hasPrefix(storeUri, "remote") || storeUri == "auto"
|| hasPrefix(storeUri, "auto") || storeUri == "daemon"
|| hasPrefix(storeUri, "/") || storeUri == "local"
|| hasPrefix(storeUri, "auto?")
|| hasPrefix(storeUri, "daemon?")
|| hasPrefix(storeUri, "local?")
|| hasPrefix(storeUri, "?")
? storeUri ? storeUri
: "ssh://" + storeUri), : "ssh://" + storeUri),
systemTypes(systemTypes), systemTypes(systemTypes),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment