@@ -117,7 +117,7 @@ def run_couchbase_command(self, couchbase_command, **kwargs):
117117
118118 logger .debug ("couchbase command to run: {}" .format (command ))
119119 stdout , stderr , exit_code = utilities .execute_bash (self .connection , command , environment_vars = env )
120- return [stdout . encode ( 'utf-8' ) , stderr . encode ( 'utf-8' ) , exit_code ]
120+ return [stdout , stderr , exit_code ]
121121
122122
123123 def run_os_command (self , os_command , ** kwargs ):
@@ -131,7 +131,7 @@ def run_os_command(self, os_command, **kwargs):
131131
132132 logger .debug ("os command to run: {}" .format (command ))
133133 stdout , stderr , exit_code = utilities .execute_bash (self .connection , command )
134- return [stdout . encode ( 'utf-8' ) , stderr . encode ( 'utf-8' ) , exit_code ]
134+ return [stdout , stderr , exit_code ]
135135
136136
137137 def restart_couchbase (self , provision = False ):
@@ -190,9 +190,9 @@ def stop_couchbase(self):
190190 except Exception as err :
191191 logger .debug ("Exception Error: {}" .format (err ))
192192 if self .status () == Status .INACTIVE :
193- logger .debug ("Seems like couchbase service is not running. {}" .format (err . message ))
193+ logger .debug ("Seems like couchbase service is not running. {}" .format (str ( err ) ))
194194 else :
195- raise CouchbaseServicesError (err . message )
195+ raise CouchbaseServicesError (str ( err ) )
196196
197197
198198 def ip_file_name (self ):
@@ -253,7 +253,7 @@ def staging_bootstrap_status(self):
253253 # TODO
254254 # rewrite it
255255 logger .debug ("Exception: {}" .format (str (error )))
256- if re .search ("Unable to connect to host at" , error . message ):
256+ if re .search ("Unable to connect to host at" , str ( error ) ):
257257 logger .debug ("Couchbase service is not running" )
258258 return Status .INACTIVE
259259
@@ -339,7 +339,7 @@ def status(self, provision=False):
339339 # TODO
340340 # rewrite it
341341 logger .debug ("Exception: {}" .format (str (error )))
342- if re .search ("Unable to connect to host at" , error . message ):
342+ if re .search ("Unable to connect to host at" , str ( error ) ):
343343 logger .debug ("Couchbase service is not running" )
344344 return Status .INACTIVE
345345
@@ -399,6 +399,8 @@ def create_config_dir(self):
399399 while loop_var :
400400 bin_directory = os .path .dirname (bin_directory )
401401 loop_var = loop_var - 1
402+ logger .debug (f"bin_directory={ bin_directory } " )
403+ logger .debug (f"DELPHIX_HIDDEN_FOLDER={ DELPHIX_HIDDEN_FOLDER } " )
402404 dir_name = bin_directory + "/" + DELPHIX_HIDDEN_FOLDER
403405 if not helper_lib .check_dir_present (self .connection , dir_name ):
404406 self .make_directory (dir_name , force_env_user = True )
@@ -440,7 +442,7 @@ def source_bucket_list(self):
440442 bucket_list = bucket_list .replace ("False" , "\" False\" " )
441443 logger .debug ("parse json" )
442444 bucket_list_dict = json .loads (bucket_list )
443- bucket_list_dict = map (helper_lib .remap_bucket_json , bucket_list_dict )
445+ bucket_list_dict = list ( map (helper_lib .remap_bucket_json , bucket_list_dict ) )
444446
445447 logger .debug ("Source Bucket Information {}" .format (bucket_list_dict ))
446448 return bucket_list_dict
@@ -488,7 +490,7 @@ def source_bucket_list_offline(self):
488490
489491 backup_list = bucket_list .split ('\n ' )
490492 logger .debug ("Bucket search output: {}" .format (backup_list ))
491- date_list = map (self .get_backup_date , backup_list )
493+ date_list = list ( map (self .get_backup_date , backup_list ))
492494 date_list .sort ()
493495 logger .debug ("date list: {}" .format (date_list ))
494496 files_to_process = [ x for x in backup_list if date_list [- 1 ] in x ]
@@ -647,7 +649,7 @@ def check_index_build(self):
647649 tobuild = 1
648650
649651 #break the loop either end_time is exceeding from 1 minute or server is successfully started
650- while time .time () < end_time and tobuild <> 0 :
652+ while time .time () < end_time and tobuild != 0 :
651653
652654 command_output , std_err , exit_code = self .run_couchbase_command (
653655 couchbase_command = 'check_index_build' ,
@@ -976,18 +978,14 @@ def rename_cluster(self):
976978
977979 logger .debug ("rename cluster - exit_code: {} stdout: {} std_err: {}" .format (exit_code , command_output , std_err ))
978980
979-
980-
981-
982-
983981 def start_node_bootstrap (self ):
984982 logger .debug ("start start_node_bootstrap" )
985983 self .start_couchbase (no_wait = True )
986984 end_time = time .time () + 3660
987985 server_status = Status .INACTIVE
988986
989987 #break the loop either end_time is exceeding from 1 minute or server is successfully started
990- while time .time () < end_time and server_status <> Status .ACTIVE :
988+ while time .time () < end_time and server_status != Status .ACTIVE :
991989 helper_lib .sleepForSecond (1 ) # waiting for 1 second
992990 server_status = self .staging_bootstrap_status () # fetching status
993991 logger .debug ("server status {}" .format (server_status ))
@@ -1068,6 +1066,6 @@ def addnode(self, nodeno, node_def):
10681066
10691067
10701068if __name__ == "__main__" :
1071- print "Checking Couchbase Class"
1069+ # print "Checking Couchbase Class"
10721070 test_object = CouchbaseOperation (Resource .ObjectBuilder .set_dsource (True ).build ())
10731071 print (test_object .get_config_file_path .__doc__ )
0 commit comments