File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1299,10 +1299,14 @@ def open(self, args):
12991299 "/api/formations/{}/calculate" .format (formation ))
13001300 if response .status_code == requests .codes .ok : # @UndefinedVariable
13011301 databag = json .loads (response .content )
1302- proxy = random .choice (databag ['nodes' ].get ('proxy' , {}).values ())
1303- # use the OS's default handler to open this URL
1304- webbrowser .open ('http://{}/' .format (proxy ))
1305- return proxy
1302+ proxies = databag ['nodes' ].get ('proxy' , {}).values ()
1303+ if proxies :
1304+ proxy = random .choice (proxies )
1305+ # use the OS's default handler to open this URL
1306+ webbrowser .open ('http://{}/' .format (proxy ))
1307+ return proxy
1308+ else :
1309+ print ('No proxies found. Use `deis layers:scale proxy=1` to scale up.' )
13061310 else :
13071311 print ('Error!' , response .text )
13081312
You can’t perform that action at this time.
0 commit comments