Skip to content

Commit

Permalink
Merge pull request #570 from cisco/release_1.8.0
Browse files Browse the repository at this point in the history
Release 1.8.0
  • Loading branch information
mikewiebe authored Dec 13, 2017
2 parents e388a13 + 7344cf4 commit 0976d7f
Show file tree
Hide file tree
Showing 90 changed files with 1,211 additions and 605 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
Changelog
=========

## [v1.8.0]

#### Cisco Resources
* ObjectGroup
* object_group (@saichint)
* object_group_entry (@saichint)

### Added
* Extend syslog_server with attributes:
* `port`
* Extend syslog_settings with attributes:
* `console`
* `monitor`
* `source_interface`
* Extend radius_global with attributes:
* `source_interface`
* Extend tacacs_global with attributes:
* `source_interface`

### Changed
* syslog_server initialize now uses options hash
* Prior to this release syslog_server accepted positional arguments for name,
level, and vrf. New behavior is to pass attributes as a hash.

Example:
```
options = { 'name' => '1.1.1.1', 'level' => '4', 'port' => '2154',
'vrf' => 'red' }
Cisco::SyslogServer.new(options, true)
```
* tacacs_global key removal fixed
* Prior to this release key removal was done by passing in a value of 8. A
nil value is now used. Added intelligence to determine key format
automatically for removal.

## [v1.7.0]

### New feature support
Expand Down Expand Up @@ -478,6 +513,7 @@ Changelog
[git-flow]: https://github.com/petervanderdoes/gitflow-avh
[SimpleCov]: https://github.com/colszowka/simplecov

[v1.8.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.7.0...v1.8.0
[v1.7.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.6.0...v1.7.0
[v1.6.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.5.0...v1.6.0
[v1.5.0]: https://github.com/cisco/cisco-network-node-utils/compare/v1.4.1...v1.5.0
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Cisco Network Elements support a rich set of features to make networks robust, e
## Getting Started

* Create a [GitHub account](https://github.com/signup/free)
* A virtual Nexus N9000/N3000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can obtain a copy of a virtual Nexus N9000/N3000 by sending their [cisco.com](http://cisco.com) user ID in an email to <get-n9kv@cisco.com>. If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)
* Please note: For Cisco Nexus 9k platforms, a virtual Nexus N9000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can [download the software on CCO.](https://software.cisco.com/download/release.html?mdfid=286312239&softwareid=282088129&release=7.0(3)I5(2)&relind=AVAILABLE&rellifecycle=&reltype=latest) If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)

## Making Changes

Expand Down Expand Up @@ -40,4 +40,4 @@ git config --global user.email [email protected]
# Additional Resources

* [General GitHub documentation](http://help.github.com/)
* [GitHub pull request documentation](http://help.github.com/send-pull-requests/)
* [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/)
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@ Platform | OS | OS Version |
------------------|--------|----------------------|
Cisco Nexus N9k | NX-OS | 7.0(3)I2(1) and later
Cisco Nexus N3k | NX-OS | 7.0(3)I2(1) and later
Cisco Nexus N3K-F | NX-OS | 7.0(3)F3(2) and later
Cisco Nexus N5k | NX-OS | 7.3(0)N1(1) and later
Cisco Nexus N6k | NX-OS | 7.3(0)N1(1) and later
Cisco Nexus N7k | NX-OS | 7.3(0)D1(1) and later
Cisco Nexus N9K-F | NX-OS | 7.0(3)F1(1) and later

Please note: For Cisco Nexus 3k and 9k platforms, a virtual Nexus N9000/N3000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can obtain a copy of a virtual Nexus N9000/N3000 by sending their [cisco.com](http://cisco.com) user ID in an email to <get-n9kv@cisco.com>. If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)
Please note: For Cisco Nexus 9k platforms, a virtual Nexus N9000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can [download the software on CCO.](https://software.cisco.com/download/release.html?mdfid=286312239&softwareid=282088129&release=7.0(3)I5(2)&relind=AVAILABLE&rellifecycle=&reltype=latest) If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)

## <a name="installation">Installation</a>

Expand Down
1 change: 1 addition & 0 deletions cisco_node_utils.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Currently supports NX-OS nodes.
spec.add_development_dependency 'bundler', '~> 1.7'
spec.add_development_dependency 'kwalify', '~> 0.7.2'
spec.add_development_dependency 'minitest', '~> 5.0'
spec.add_development_dependency 'net-telnet', '~> 0.1.1'
spec.add_development_dependency 'rake', '~> 10.0'
spec.add_development_dependency 'rspec', '~> 3.0'
spec.add_development_dependency 'rubocop', '= 0.35.1'
Expand Down
3 changes: 2 additions & 1 deletion docs/README-develop-node-utils-APIs.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ fi

### <a name="prereq_vm">Nexus VM (optional)</a>

A virtual Nexus N9000/N3000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can obtain a copy of a virtual Nexus N9000/N3000 by sending their [cisco.com](http://cisco.com) user ID in an email to <[email protected]>. If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)
A virtual Nexus N9000 may be helpful for development and testing. Users with a valid [cisco.com](http://cisco.com) user ID can [download the software on CCO.](https://software.cisco.com/download/release.html?mdfid=286312239&softwareid=282088129&release=7.0(3)I5(2)&relind=AVAILABLE&rellifecycle=&reltype=latest) If you do not have a [cisco.com](http://cisco.com) user ID please register for one at [https://tools.cisco.com/IDREG/guestRegistration](https://tools.cisco.com/IDREG/guestRegistration)



## <a name="clone">Start here: Fork and Clone the Repo</a>
Expand Down
4 changes: 2 additions & 2 deletions lib/cisco_node_utils/aaa_authentication_login_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def destroy
if g_str.empty?
# cannot remove default local, so do nothing in this case
unless m == :local
unless node.product_id[/N9K-F/]
# TBD: These 'no' commands currently error on N9K-F
unless node.product_id[/N(3|9)K-F/]
# TBD: These 'no' commands currently error on N(3|9)K-F
# no aaa authentication login console local
# no aaa authentication login console none
config_set('aaa_auth_login_service', 'method',
Expand Down
2 changes: 2 additions & 0 deletions lib/cisco_node_utils/ace.rb
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ def tcp_flags=(tcp_flags)

def established
match = ace_get
return nil unless remark.nil?
return false if match.nil?
return false unless match.names.include?('established')
match[:established] == 'established' ? true : false
Expand Down Expand Up @@ -318,6 +319,7 @@ def redirect=(redirect)

def log
match = ace_get
return nil unless remark.nil?
return false if match.nil?
return false unless match.names.include?('log')
match[:log] == 'log' ? true : false
Expand Down
125 changes: 34 additions & 91 deletions lib/cisco_node_utils/bgp.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# June 2015, Michael G Wiebe
#
# Copyright (c) 2015-2016 Cisco and/or its affiliates.
# Copyright (c) 2015-2017 Cisco and/or its affiliates.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,9 +56,9 @@ def self.routers
end
hash_final.merge!(hash_tmp)
return hash_final
rescue Cisco::CliError => e
# cmd will syntax reject when feature is not enabled
raise unless e.clierror =~ /Syntax error/
rescue Cisco::CliError
# cmd will error when feature 'bgp' is not enabled
raise if Feature.bgp_enabled?
return {}
end

Expand Down Expand Up @@ -414,14 +414,11 @@ def default_enforce_first_as
# Nvgen as True With optional 'size <size>
def event_history_cli
match = config_get('bgp', 'event_history_cli', @get_args)
if match.is_a?(Array)
return 'false' if match[0] == 'no '
if match[1]
return match[1] if match[1][/\A\d+\z/]
return 'size_' + match[1]
end
end
default_event_history_cli
return unless match.is_a?(Array)
return 'false' if match[0] == 'no '
return unless match[1]
return match[1] if match[1][/\A\d+\z/]
'size_' + match[1]
end

def event_history_cli=(val)
Expand All @@ -432,23 +429,15 @@ def event_history_cli=(val)
set_args_keys_default
end

def default_event_history_cli
config_get_default('bgp', 'event_history_cli')
end

# event-history detail [ size <size> ]
# Nvgen as True With optional 'size <size>
def event_history_detail
match = config_get('bgp', 'event_history_detail', @get_args)
if match.is_a?(Array)
return 'false' if match[0] == 'no '
if match[1]
return match[1] if match[1][/\A\d+\z/]
return 'size_' + match[1]
end
return 'true'
end
default_event_history_detail
return unless match.is_a?(Array)
return 'false' if match[0] == 'no '
return 'true' unless match[1]
return match[1] if match[1][/\A\d+\z/]
'size_' + match[1]
end

def event_history_detail=(val)
Expand All @@ -459,22 +448,15 @@ def event_history_detail=(val)
set_args_keys_default
end

def default_event_history_detail
config_get_default('bgp', 'event_history_detail')
end

# event-history errors [ size <size> ]
# Nvgen as True With optional 'size <size>
def event_history_errors
match = config_get('bgp', 'event_history_errors', @get_args)
if match.is_a?(Array)
return 'false' if match[0] == 'no '
if match[1]
return match[1] if match[1][/\A\d+\z/]
return 'size_' + match[1]
end
end
default_event_history_errors
return unless match.is_a?(Array)
return 'false' if match[0] == 'no '
return unless match[1]
return match[1] if match[1][/\A\d+\z/]
'size_' + match[1]
end

def event_history_errors=(val)
Expand All @@ -485,22 +467,15 @@ def event_history_errors=(val)
set_args_keys_default
end

def default_event_history_errors
config_get_default('bgp', 'event_history_errors')
end

# event-history events [ size <size> ]
# Nvgen as True With optional 'size <size>
def event_history_events
match = config_get('bgp', 'event_history_events', @get_args)
if match.is_a?(Array)
return 'false' if match[0] == 'no '
if match[1]
return match[1] if match[1][/\A\d+\z/]
return 'size_' + match[1]
end
end
default_event_history_events
return unless match.is_a?(Array)
return 'false' if match[0] == 'no '
return unless match[1]
return match[1] if match[1][/\A\d+\z/]
'size_' + match[1]
end

def event_history_events=(val)
Expand All @@ -511,28 +486,15 @@ def event_history_events=(val)
set_args_keys_default
end

def default_event_history_events
if Utils.image_version?(/7.0.3.I2|I3|I4/) ||
node.product_id[/(N5|N6|N7|N9.*-F)/]
config_get_default('bgp', 'event_history_events')
else
config_get('bgp', 'event_history_events_bytes', @get_args)
end
end

# event-history objstore [ size <size> ]
# Nvgen as True With optional 'size <size>
def event_history_objstore
match = config_get('bgp', 'event_history_objstore', @get_args)
if match.is_a?(Array)
return 'false' if match[0] == 'no '
if match[1]
return match[1] if match[1][/\A\d+\z/]
return 'size_' + match[1]
end
return 'true'
end
default_event_history_objstore
return unless match.is_a?(Array)
return 'false' if match[0] == 'no '
return 'true' unless match[1]
return match[1] if match[1][/\A\d+\z/]
'size_' + match[1]
end

def event_history_objstore=(val)
Expand All @@ -543,25 +505,15 @@ def event_history_objstore=(val)
set_args_keys_default
end

def default_event_history_objstore
config_get_default('bgp', 'event_history_objstore')
end

# event-history periodic [ size <size> ]
# Nvgen as True With optional 'size <size>
def event_history_periodic
match = config_get('bgp', 'event_history_periodic', @get_args)
if match.is_a?(Array)
return 'false' if match[0] == 'no '
if match[1]
return match[1] if match[1][/\A\d+\z/]
return 'size_' + match[1]
end
else
return default_event_history_periodic
end
return 'true' unless default_event_history_periodic[/size/]
default_event_history_periodic
return unless match.is_a?(Array)
return 'false' if match[0] == 'no '
return unless match[1]
return match[1] if match[1][/\A\d+\z/]
'size_' + match[1]
end

def event_history_periodic=(val)
Expand All @@ -572,15 +524,6 @@ def event_history_periodic=(val)
set_args_keys_default
end

def default_event_history_periodic
if Utils.image_version?(/7.0.3.I2|I3|I4/) ||
node.product_id[/(N5|N6|N7|N9.*-F)/]
config_get_default('bgp', 'event_history_periodic')
else
config_get('bgp', 'event_history_periodic_bytes', @get_args)
end
end

# Fast External fallover (Getter/Setter/Default)
def fast_external_fallover
config_get('bgp', 'fast_external_fallover', @get_args)
Expand Down
21 changes: 8 additions & 13 deletions lib/cisco_node_utils/bridge_domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,30 +124,27 @@ def destroy
# PROPERTIES #
########################################################

# Bridge-Domain name assigning case
# bridge-domain 100
# name bd100
def bd_name
config_get('bridge_domain', 'bd_name', bd: @bd_ids)
end

def bd_name=(str)
str = str.to_s
state = str.empty? ? 'no' : ''
config_set('bridge_domain', 'bd_name', bd: @bd_ids, state: state,
name: str)
end

# This default getter is a bit different them most. When a brige-domain
# gets created it gets a default name assigned that follows the pattern
# 'Bridge-DomainX' where X is the bridge domain id (@bd_ids).
def default_bd_name
config_get_default('bridge_domain', 'bd_name')
'Bridge-Domain' + @bd_ids
end

# Bridge-Domain type change to fabric-control
# bridge-domain 100
# fabric-control
# This type property can be defined only for one bd
def fabric_control
config_get('bridge_domain', 'fabric_control', bd: @bd_ids)
match = config_get('bridge_domain', 'fabric_control', bd: @bd_ids)
match == @bd_ids ? true : false
end

def fabric_control=(val)
Expand All @@ -159,11 +156,9 @@ def default_fabric_control
config_get_default('bridge_domain', 'fabric_control')
end

# Bridge-Domain Shutdown case
# bridge-domain 100
# shutdown
def shutdown
config_get('bridge_domain', 'shutdown', bd: @bd_ids)
match = config_get('bridge_domain', 'shutdown', bd: @bd_ids)
match == 'Noshutdown' ? false : true
end

def shutdown=(val)
Expand Down
Loading

0 comments on commit 0976d7f

Please sign in to comment.