diff options
author | Christian Trautman <ctrautma@redhat.com> | 2016-07-08 01:41:39 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2016-07-08 01:41:39 +0000 |
commit | 7a16aa0bc7875b5b3fe6385cf99afa076e1e1cb3 (patch) | |
tree | f997b7e84de4fa34ed5e261b568044fcf988e097 /src | |
parent | cead9a3d0571b8afc5ed680475e9bc3ea92c7d79 (diff) | |
parent | 45956037d0233bad1a9fc01cb390fcc8e9e30005 (diff) |
Merge "rstp-stp: Add basic functions for stp/rstp enable on ovs"
Diffstat (limited to 'src')
-rw-r--r-- | src/ovs/ofctl.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/ovs/ofctl.py b/src/ovs/ofctl.py index 1ee48133..d7a2b320 100644 --- a/src/ovs/ofctl.py +++ b/src/ovs/ofctl.py @@ -349,6 +349,37 @@ class OFBridge(OFBase): self.logger.debug('dump flows') self.run_ofctl(['dump-flows', self.br_name], timeout=120) + def set_stp(self, enable=True): + """ + Set stp status + :param enable: Boolean to enable or disable stp + :return: None + """ + self.logger.debug( + 'Setting stp on bridge to %s', 'on' if enable else 'off') + self.run_vsctl( + ['set', 'Bridge', self.br_name, 'stp_enable={}'.format( + 'true' if enable else 'false')]) + + def set_rstp(self, enable=True): + """ + Set rstp status + :param enable: Boolean to enable or disable rstp + :return: None + """ + self.logger.debug( + 'Setting rstp on bridge to %s', 'on' if enable else 'off') + self.run_vsctl( + ['set', 'Bridge', self.br_name, 'rstp_enable={}'.format( + 'true' if enable else 'false')]) + + def bridge_info(self): + """ + Get bridge info + :return: Returns bridge info from list bridge command + """ + return self.run_vsctl(['list', 'bridge', self.br_name]) + # # helper functions # |