From 72d0d8768f03ce78dff29404e1e73ee39ff2fc39 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 3 Apr 2020 14:27:34 +0200 Subject: validate: mac: autopep8 --- src/validators/mac-address | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) (limited to 'src/validators/mac-address') diff --git a/src/validators/mac-address b/src/validators/mac-address index d6ec6d712..435920b84 100755 --- a/src/validators/mac-address +++ b/src/validators/mac-address @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2018 VyOS maintainers and contributors +# Copyright (C) 2018-2020 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -13,16 +13,14 @@ # # You should have received a copy of the GNU General Public License # along with this program. If not, see . -# -# -import sys import re +from sys import exit, argv -if len(sys.argv) == 2: - pattern = "^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$" - if re.match(pattern, sys.argv[1]): - sys.exit(0) - else: - sys.exit(1) +if len(argv) == 2: + pattern = "^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$" + if re.match(pattern, argv[1]): + exit(0) + else: + exit(1) -- cgit v1.2.3