def vlan_in_use(segmentation_id, namespace=None):
 ip_wrapper = IPWrapper(namespace=namespace)
 interfaces = ip_wrapper.netns.execute(['ip', '-d', 'link', 'list'], check_exit_code=True)
 return (('802.1Q id %s ' % segmentation_id) in interfaces)

def vlan_in_use ( segmentation_id , namespace = None ) : ip_wrapper = IPWrapper ( namespace = namespace ) interfaces = ip_wrapper . netns . execute ( [ 'ip' , '-d' , 'link' , 'list' ] , check_exit_code = True ) return ( ( '802.1Q id %s ' % segmentation_id ) in interfaces )
return true if vlan id is in use by an interface .