@@ -295,13 +295,8 @@ def auth_register(self, args):
295295 password = getpass ('password: ' )
296296 email = args .get ('--email' )
297297 if not email :
298- < << << << HEAD
299298 email = raw_input ('email: ' )
300299 url = urlparse .urljoin (controller , '/api/auth/register' )
301- == == == =
302- email = raw_input ('email: ' )
303- url = urlparse .urljoin (controller , '/api/register' )
304- >> >> >> > master
305300 payload = {'username' : username , 'password' : password , 'email' : email }
306301 response = self ._session .post (url , data = payload , allow_redirects = False )
307302 if response .status_code == requests .codes .created : # @UndefinedVariable
@@ -359,22 +354,6 @@ def auth_logout(self, args):
359354 self ._settings .save ()
360355 print ('Logged out' )
361356
362- < << << << HEAD
363- == == == =
364- def backends_list (self , args ):
365- formation = args .get ('--formation' )
366- if not formation :
367- formation = self ._session .formation
368- response = self ._dispatch ('get' , "/formations/{}/backends" .format (formation ))
369- if response .status_code == requests .codes .ok : # @UndefinedVariable
370- print ('=== {0}' .format (formation ))
371- data = response .json ()
372- for item in data ['results' ]:
373- print ('{0[uuid]:<23} {0[created]}' .format (item ))
374- else :
375- print ('Error!' , response .text )
376-
377- >> >> >> > master
378357 def builds_create (self , args ):
379358 formation = args .get ('--formation' )
380359 if not formation :
@@ -496,31 +475,8 @@ def containers_scale(self, args):
496475 '/api/formations/{}/scale/containers' .format (formation ),
497476 json .dumps (body ))
498477 if response .status_code == requests .codes .ok : # @UndefinedVariable
499- < << << << HEAD
500478 databag = json .loads (response .content )
501479 print (json .dumps (databag , indent = 2 ))
502- == == == =
503- data = response .json ()
504- if data ['count' ] == 0 :
505- print 'No keys found'
506- return
507- print ('=== {0} Keys' .format (data ['results' ][0 ]['owner' ]))
508- for key in data ['results' ]:
509- public = key ['public' ]
510- print ('{0} {1}...{2}' .format (
511- key ['id' ], public [0 :16 ], public [- 10 :]))
512- else :
513- print ('Error!' , response .text )
514-
515- def keys_remove (self , args ):
516- """Remove a specific SSH key for the logged in user."""
517- key = args .get ('<key>' )
518- sys .stdout .write ('Removing {0} SSH Key... ' .format (key ))
519- sys .stdout .flush ()
520- response = self ._dispatch ('delete' , '/keys/{}' .format (key ))
521- if response .status_code == requests .codes .no_content : # @UndefinedVariable
522- print ('done' )
523- > >> >> >> master
524480 else :
525481 print ('Error!' , response .text )
526482
@@ -647,18 +603,8 @@ def formations_calculate(self, args):
647603 formation = args .get ('--formation' )
648604 if not formation :
649605 formation = self ._session .formation
650- < << << << HEAD
651606 response = self ._dispatch ('post' ,
652607 '/api/formations/{}/calculate' .format (formation ))
653- == == == =
654- body = {}
655- for type_num in args .get ('<type=num>' ):
656- typ , count = type_num .split ('=' )
657- body .update ({typ : int (count )})
658- response = self ._dispatch ('post' ,
659- '/api/formations/{}/scale' .format (formation ),
660- json .dumps (body ))
661- >> >> >> > master
662608 if response .status_code == requests .codes .ok : # @UndefinedVariable
663609 databag = json .loads (response .content )
664610 print (json .dumps (databag , indent = 2 ))
@@ -669,13 +615,8 @@ def formations_balance(self, args):
669615 formation = args .get ('--formation' )
670616 if not formation :
671617 formation = self ._session .formation
672- < << << << HEAD
673618 response = self ._dispatch ('post' ,
674619 '/api/formations/{}/balance' .format (formation ))
675- == == == =
676- response = self ._dispatch ('post' ,
677- '/api/formations/{}/calculate' .format (formation ))
678- >> >> >> > master
679620 if response .status_code == requests .codes .ok : # @UndefinedVariable
680621 databag = json .loads (response .content )
681622 print (json .dumps (databag , indent = 2 ))
@@ -686,13 +627,8 @@ def formations_converge(self, args):
686627 formation = args .get ('--formation' )
687628 if not formation :
688629 formation = self ._session .formation
689- < << << << HEAD
690630 response = self ._dispatch ('post' ,
691631 '/api/formations/{}/converge' .format (formation ))
692- == == == =
693- response = self ._dispatch ('post' ,
694- '/api/formations/{}/balance' .format (formation ))
695- >> >> >> > master
696632 if response .status_code == requests .codes .ok : # @UndefinedVariable
697633 databag = json .loads (response .content )
698634 print (json .dumps (databag , indent = 2 ))
@@ -784,7 +720,6 @@ def layers_destroy(self, args):
784720 formation = args .get ('--formation' )
785721 if not formation :
786722 formation = self ._session .formation
787- < << << << HEAD
788723 layer = args ['<id>' ]
789724 sys .stdout .write ('Destroying layer {layer}...' .format (** locals ()))
790725 sys .stdout .flush ()
@@ -822,10 +757,6 @@ def layers_scale(self, args):
822757 response = self ._dispatch ('post' ,
823758 '/api/formations/{}/scale/layers' .format (formation ),
824759 json .dumps (body ))
825- == == == =
826- response = self ._dispatch ('post' ,
827- '/api/formations/{}/converge' .format (formation ))
828- >> >> >> > master
829760 if response .status_code == requests .codes .ok : # @UndefinedVariable
830761 databag = json .loads (response .content )
831762 print (json .dumps (databag , indent = 2 ))
0 commit comments