diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2015-08-20 22:55:32 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2015-08-20 22:55:32 +0200 |
commit | f850d14d6690d3b713be545e9f57623615aa7304 (patch) | |
tree | 329e1b9bd43566d4de4c65049231c41b39f23200 /tools | |
parent | Merge branch 'cmaster' of ssh://stash.cumulusnetworks.com:7999/quag/quagga in... (diff) | |
download | frr-f850d14d6690d3b713be545e9f57623615aa7304.tar.xz frr-f850d14d6690d3b713be545e9f57623615aa7304.zip |
'service quagga reload' fails if /etc/quagga/vtysh.conf does not exist
Ticket: CM-7146
Reviewed By: teo@cumulusnetworks.com
Testing Done:
/usr/lib/quagga/quagga-reload.py needs to check that
/etc/quagga/vtysh.conf exists before trying to open it
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/quagga-reload.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/quagga-reload.py b/tools/quagga-reload.py index d3b06daba..1744a1336 100755 --- a/tools/quagga-reload.py +++ b/tools/quagga-reload.py @@ -468,16 +468,16 @@ if __name__ == '__main__': # Verify that 'service integrated-vtysh-config' is configured vtysh_filename = '/etc/quagga/vtysh.conf' - fh = open(vtysh_filename, 'r') service_integrated_vtysh_config = False - for line in fh.readlines(): - line = line.strip() + if os.path.isfile(vtysh_filename): + with open(vtysh_filename, 'r') as fh: + for line in fh.readlines(): + line = line.strip() - if line == 'service integrated-vtysh-config': - service_integrated_vtysh_config = True - break - fh.close() + if line == 'service integrated-vtysh-config': + service_integrated_vtysh_config = True + break if not service_integrated_vtysh_config: print "'service integrated-vtysh-config' is not configured, this is required for 'service quagga reload'" |