mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	- added wait for scenario to be build
- added show text blob to reflect changes in GUI - changed if-elif t0 if-if - removed some sleep Signed-off-by: SushantBawiskar <sushant.bawiskar@candelatech.com>
This commit is contained in:
		@@ -65,17 +65,13 @@ class CreateChamberview(cv):
 | 
				
			|||||||
             line="",
 | 
					             line="",
 | 
				
			||||||
             raw_line=[]):
 | 
					             raw_line=[]):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #check for any raw lines
 | 
					 | 
				
			||||||
        print(raw_line)
 | 
					 | 
				
			||||||
        if raw_line:
 | 
					        if raw_line:
 | 
				
			||||||
            print(raw_line)
 | 
					            print("creating %s scenario" % create_scenario)
 | 
				
			||||||
            for create_lines in raw_line:
 | 
					            for create_lines in raw_line:
 | 
				
			||||||
                print("create_lines[0]: ", create_lines[0])
 | 
					 | 
				
			||||||
                self.pass_raw_lines_to_cv(create_scenario,create_lines[0])
 | 
					                self.pass_raw_lines_to_cv(create_scenario,create_lines[0])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        #check for lines
 | 
					        #check for lines
 | 
				
			||||||
        elif line:
 | 
					        if line:
 | 
				
			||||||
            print(line)
 | 
					 | 
				
			||||||
            scenario_name = create_scenario
 | 
					            scenario_name = create_scenario
 | 
				
			||||||
            line = line
 | 
					            line = line
 | 
				
			||||||
            Resource = "1.1"
 | 
					            Resource = "1.1"
 | 
				
			||||||
@@ -92,23 +88,17 @@ class CreateChamberview(cv):
 | 
				
			|||||||
            for i in range(len(line)):
 | 
					            for i in range(len(line)):
 | 
				
			||||||
                if " " in line[i][0]:
 | 
					                if " " in line[i][0]:
 | 
				
			||||||
                    line[i][0] = (re.split(' ', line[i][0]))
 | 
					                    line[i][0] = (re.split(' ', line[i][0]))
 | 
				
			||||||
                    print(line[i][0])
 | 
					 | 
				
			||||||
                elif "," in line[i][0]:
 | 
					                elif "," in line[i][0]:
 | 
				
			||||||
                    line[i][0] = (re.split(',', line[i][0]))
 | 
					                    line[i][0] = (re.split(',', line[i][0]))
 | 
				
			||||||
                    print(line[i][0])
 | 
					 | 
				
			||||||
                    print("in second")
 | 
					 | 
				
			||||||
                elif ", " in line[i][0]:
 | 
					                elif ", " in line[i][0]:
 | 
				
			||||||
                    line[i][0] = (re.split(',', line[i][0]))
 | 
					                    line[i][0] = (re.split(',', line[i][0]))
 | 
				
			||||||
                    print(line[i][0])
 | 
					 | 
				
			||||||
                    print("in third")
 | 
					 | 
				
			||||||
                elif " ," in line[i][0]:
 | 
					                elif " ," in line[i][0]:
 | 
				
			||||||
                    line[i][0] = (re.split(',', line[i][0]))
 | 
					                    line[i][0] = (re.split(',', line[i][0]))
 | 
				
			||||||
                    print(line[i][0])
 | 
					 | 
				
			||||||
                    print("in forth")
 | 
					 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    print("Wrong arguments entered !")
 | 
					                    print("Wrong arguments entered !")
 | 
				
			||||||
                    exit(1)
 | 
					                    exit(1)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                print("creating %s scenario" % scenario_name)
 | 
				
			||||||
                for j in range(len(line[i][0])):
 | 
					                for j in range(len(line[i][0])):
 | 
				
			||||||
                    line[i][0][j] = line[i][0][j].split("=")
 | 
					                    line[i][0][j] = line[i][0][j].split("=")
 | 
				
			||||||
                    for k in range(len(line[i][0][j])):
 | 
					                    for k in range(len(line[i][0][j])):
 | 
				
			||||||
@@ -148,23 +138,22 @@ class CreateChamberview(cv):
 | 
				
			|||||||
                                            Freq,
 | 
					                                            Freq,
 | 
				
			||||||
                                            VLAN
 | 
					                                            VLAN
 | 
				
			||||||
                                            );  # To manage scenario
 | 
					                                            );  # To manage scenario
 | 
				
			||||||
        else:
 | 
					        if not line and not raw_line:
 | 
				
			||||||
            raise Exception("scenario sceation failed")
 | 
					            raise Exception("scenario sceation failed")
 | 
				
			||||||
            return False
 | 
					            return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return True
 | 
					        return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def build(self,scenario_name):
 | 
					    def build(self,scenario_name):
 | 
				
			||||||
        self.sync_cv()  # chamberview sync
 | 
					        self.sync_cv()  # chamberview sync
 | 
				
			||||||
        time.sleep(2)
 | 
					        time.sleep(2)
 | 
				
			||||||
        self.apply_cv_scenario(scenario_name)  # Apply scenario
 | 
					        self.apply_cv_scenario(scenario_name)  # Apply scenario
 | 
				
			||||||
        self.show_text_blob(None, None, False)
 | 
					        self.show_text_blob(None, None, False) # Show changes on GUI
 | 
				
			||||||
        # time.sleep(2)
 | 
					 | 
				
			||||||
        # self.sync_cv()
 | 
					 | 
				
			||||||
        # time.sleep(2)
 | 
					 | 
				
			||||||
        self.apply_cv_scenario(scenario_name)  # Apply scenario
 | 
					        self.apply_cv_scenario(scenario_name)  # Apply scenario
 | 
				
			||||||
        # time.sleep(2)
 | 
					 | 
				
			||||||
        self.build_cv_scenario()  # build scenario
 | 
					        self.build_cv_scenario()  # build scenario
 | 
				
			||||||
        print("End")
 | 
					        while self.is_cv_build() == "NO": continue  # wait for cv to build
 | 
				
			||||||
 | 
					        print("completed building %s scenario" %scenario_name)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def main():
 | 
					def main():
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user