Fixed HTTP proxy things for env
This commit is contained in:
@@ -682,6 +682,60 @@ class AppBase:
|
||||
else:
|
||||
return returns
|
||||
|
||||
def set_cache(self, key, value):
|
||||
org_id = self.full_execution["workflow"]["execution_org"]["id"]
|
||||
url = "%s/api/v1/orgs/%s/set_cache" % (self.url, org_id)
|
||||
data = {
|
||||
"workflow_id": self.full_execution["workflow"]["id"],
|
||||
"execution_id": self.current_execution_id,
|
||||
"authorization": self.authorization,
|
||||
"org_id": org_id,
|
||||
"key": key,
|
||||
"value": str(value),
|
||||
}
|
||||
|
||||
response = requests.post(url, json=data)
|
||||
try:
|
||||
allvalues = response.json()
|
||||
allvalues["key"] = key
|
||||
allvalues["value"] = str(value)
|
||||
return allvalues
|
||||
except:
|
||||
print("Value couldn't be parsed")
|
||||
#return response.json()
|
||||
return {"success": False}
|
||||
|
||||
def get_cache(self, key):
|
||||
org_id = self.full_execution["workflow"]["execution_org"]["id"]
|
||||
url = "%s/api/v1/orgs/%s/get_cache" % (self.url, org_id)
|
||||
data = {
|
||||
"workflow_id": self.full_execution["workflow"]["id"],
|
||||
"execution_id": self.current_execution_id,
|
||||
"authorization": self.authorization,
|
||||
"org_id": org_id,
|
||||
"key": key,
|
||||
}
|
||||
|
||||
value = requests.post(url, json=data)
|
||||
try:
|
||||
allvalues = value.json()
|
||||
print("VAL1: ", allvalues)
|
||||
allvalues["key"] = key
|
||||
print("VAL2: ", allvalues)
|
||||
|
||||
try:
|
||||
parsedvalue = json.loads(allvalues["value"])
|
||||
allvalues["value"] = parsedvalue
|
||||
except:
|
||||
print("Parsing of value as JSON failed")
|
||||
return {"success": False}
|
||||
|
||||
return allvalues
|
||||
except:
|
||||
print("Value couldn't be parsed, or json dump of value failed")
|
||||
#return value.json()
|
||||
return {"success": False}
|
||||
|
||||
# Sets files in the backend
|
||||
def set_files(self, infiles):
|
||||
full_execution = self.full_execution
|
||||
|
||||
@@ -2,7 +2,7 @@ module shuffle
|
||||
|
||||
go 1.13
|
||||
|
||||
replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||
//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared
|
||||
|
||||
//replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi
|
||||
|
||||
@@ -24,7 +24,7 @@ require (
|
||||
github.com/elastic/go-elasticsearch/v7 v7.12.0 // indirect
|
||||
github.com/elastic/go-elasticsearch/v8 v8.0.0-20210519083322-55daf7425ecb // indirect
|
||||
github.com/frikky/kin-openapi v0.39.0
|
||||
github.com/frikky/shuffle-shared v0.0.53
|
||||
github.com/frikky/shuffle-shared v0.0.54
|
||||
github.com/fsouza/go-dockerclient v1.7.2 // indirect
|
||||
github.com/ghodss/yaml v1.0.0
|
||||
github.com/go-git/go-billy/v5 v5.0.0
|
||||
|
||||
@@ -165,6 +165,8 @@ github.com/frikky/shuffle-shared v0.0.52 h1:sCSJl6WakYit32UjaRn0wsy4YhTBE6QZbCof
|
||||
github.com/frikky/shuffle-shared v0.0.52/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||
github.com/frikky/shuffle-shared v0.0.53 h1:TszF/PoJ3JrfEf7qCGdN0So3bDbofNxh4Fqqz1KlH7Q=
|
||||
github.com/frikky/shuffle-shared v0.0.53/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||
github.com/frikky/shuffle-shared v0.0.54 h1:rc8JcavY6uDxaIkXFwLVotfv3/epXUzuCWzRCozZNGg=
|
||||
github.com/frikky/shuffle-shared v0.0.54/go.mod h1:BknTfpun3qte5bumR3OqQHf9XWPIsyj8woiXCjIlbBc=
|
||||
github.com/fsouza/go-dockerclient v1.7.2 h1:bBEAcqLTkpq205jooP5RVroUKiVEWgGecHyeZc4OFjo=
|
||||
github.com/fsouza/go-dockerclient v1.7.2/go.mod h1:+ugtMCVRwnPfY7d8/baCzZ3uwB0BrG5DB8OzbtxaRz8=
|
||||
github.com/getkin/kin-openapi v0.8.0 h1:a6TQjTqwkyscC4/hShJX7WhCVE+4bi9lzw61XHQW5hE=
|
||||
|
||||
@@ -5686,7 +5686,7 @@ func initHandlers() {
|
||||
log.Printf("[DEBUG] Setting Opensearch proxy to %s", httpProxy)
|
||||
transport.Proxy = http.ProxyURL(url_proxy)
|
||||
} else {
|
||||
log.PrintF("[ERROR] Failed setting proxy for %s", httpProxy)
|
||||
log.Printf("[ERROR] Failed setting proxy for %s", httpProxy)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user