diff options
author | hochikong <1097225749@qq.com> | 2016-08-21 19:37:29 +0800 |
---|---|---|
committer | hochikong <1097225749@qq.com> | 2016-08-21 19:37:29 +0800 |
commit | 655811f476a95b8eac2f65c78323a982d59eff1b (patch) | |
tree | 6aa2a938dfb73d1b185f56f026fbb519197a2bf3 /vyroute/basic_function/StaticRoute.py | |
parent | 2584bea48c4c243fdf694cb21505bfbde6834a7f (diff) | |
download | python-vyos-mgmt-655811f476a95b8eac2f65c78323a982d59eff1b.tar.gz python-vyos-mgmt-655811f476a95b8eac2f65c78323a982d59eff1b.zip |
T133:Add a generic method set() and delete()
Rename the project
Add set and delete method
Rewrite README
Diffstat (limited to 'vyroute/basic_function/StaticRoute.py')
-rw-r--r-- | vyroute/basic_function/StaticRoute.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/vyroute/basic_function/StaticRoute.py b/vyroute/basic_function/StaticRoute.py deleted file mode 100644 index d210785..0000000 --- a/vyroute/basic_function/StaticRoute.py +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) 2016 Hochikong -def staticroute(obj, network_range, next_hop, distance): - """This method provide a basic static router configuration function - - Parameter example: - 'network_range':'10.20.10.0/24' - 'next-hop':'10.20.10.1' - 'distance':'1' - - :param obj: A connection object - :param network_range: The target network,don't forget the netmask - :param next_hop: The next hop - :param distance: The distance - :return: A message or an error - """ - static_basic_configuration = "set protocols static route %s next-hop %s distance %s" - - try: - # Configure static router - obj.sendline(static_basic_configuration % (network_range, next_hop, distance)) - obj.prompt() - if len(obj.before) > obj.before.index('\r\n') + 2: - return obj.before - else: - return "Result : Configured successfully" - except Exception as e: - return e |