mirror of
				https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
				synced 2025-11-04 04:38:02 +00:00 
			
		
		
		
	adding bridge as flag value and removing hardcoded resources
This commit is contained in:
		@@ -213,7 +213,7 @@ class VAPProfile(LFCliBase):
 | 
			
		||||
 | 
			
		||||
    def create(self, resource, radio, channel=None, up_=None, debug=False, use_ht40=True, use_ht80=True,
 | 
			
		||||
               use_ht160=False,
 | 
			
		||||
               suppress_related_commands_=True, use_radius=False, hs20_enable=False):
 | 
			
		||||
               suppress_related_commands_=True, use_radius=False, hs20_enable=False, bridge=True):
 | 
			
		||||
        port_list = self.local_realm.json_get("port/1/1/list")
 | 
			
		||||
        if port_list is not None:
 | 
			
		||||
            port_list = port_list['interfaces']
 | 
			
		||||
@@ -329,6 +329,8 @@ class VAPProfile(LFCliBase):
 | 
			
		||||
                        time.sleep(5)
 | 
			
		||||
 | 
			
		||||
        # create bridge
 | 
			
		||||
        if bridge :
 | 
			
		||||
            print("creating bridge")
 | 
			
		||||
            data = {
 | 
			
		||||
                "shelf": 1,
 | 
			
		||||
                "resource": resource,
 | 
			
		||||
@@ -339,7 +341,7 @@ class VAPProfile(LFCliBase):
 | 
			
		||||
 | 
			
		||||
            bridge_set_port = {
 | 
			
		||||
                "shelf": 1,
 | 
			
		||||
            "resource": 1,
 | 
			
		||||
                "resource": resource,
 | 
			
		||||
                "port": "br0",
 | 
			
		||||
                "current_flags": 0x80000000,
 | 
			
		||||
                "interest": 0x4000  # (0x2 + 0x4000 + 0x800000)  # current, dhcp, down
 | 
			
		||||
@@ -347,7 +349,7 @@ class VAPProfile(LFCliBase):
 | 
			
		||||
            self.local_realm.json_post("cli-json/set_port", bridge_set_port)
 | 
			
		||||
 | 
			
		||||
        if (self.up):
 | 
			
		||||
            self.admin_up(1)
 | 
			
		||||
            self.admin_up(resource)
 | 
			
		||||
 | 
			
		||||
    def cleanup(self, resource, delay=0.03):
 | 
			
		||||
        print("Cleaning up VAPs")
 | 
			
		||||
@@ -361,3 +363,4 @@ class VAPProfile(LFCliBase):
 | 
			
		||||
 | 
			
		||||
        # And now see if they are gone
 | 
			
		||||
        LFUtils.wait_until_ports_disappear(base_url=self.lfclient_url, port_list=desired_ports)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user