diff options
-rw-r--r-- | util.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -203,6 +203,11 @@ class VlanUtil: db = state.db config = state.config + # Check for tag == -1, i.e. use the next available tag + if tag == -1: + tag = db.find_lowest_unused_vlan_tag() + logging.debug('create_vlan called with a tag of -1, found first unused tag %d', tag) + # 1. Database record first try: logging.debug('Adding DB record first: name %s, tag %d, is_base_vlan %d', name, tag, is_base_vlan) @@ -291,7 +296,7 @@ class VlanUtil: s.switch_disconnect() del s - return vlan_id # If we're successful + return (vlan_id, tag) # If we're successful # Complex call # 1. Check in the DB if there are any ports on the VLAN. Bail if so |