shopify-junos-ez-stdlib 1.0.0 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 35f03b58ce9cfea7aee6a2bf7cb00f69721692d8
4
- data.tar.gz: a38199a944c32a844c185d01508d9e704de28744
2
+ SHA256:
3
+ metadata.gz: '001948c69dd5b4bba8e4e3dc0dc97780a2287398cb0e057add042315e24c77c0'
4
+ data.tar.gz: b06891f741f1780460ffe6033734b88cddf8f7de499b57dce6f66fbc9861c3f0
5
5
  SHA512:
6
- metadata.gz: 032c27f113348d914b8441470bf784efdb34acbbea615d5d7d5612fd7620b72c7273dc88414aac38a39d1356f7ac45412bbbf3ab7c8511aa75b0b4f08936aff9
7
- data.tar.gz: 3a947882c3ca848b08daea12cbe66ab104536ebbec5ac0473db3f26d737f63025e12e3d72e0080927c3f5fe63694b2a6ca5a54734f8af598fa62d805f53dec66
6
+ metadata.gz: a203c6392b0b9d18053e9f7bee33a14b7da5c2c220442ef163495147e0c13fc40ff1bc82c5f822ac8decbdf67906571665a5e97d5008b4c2717d97b6b64424b5
7
+ data.tar.gz: 5ffa570bff5a4e4e3ba1b86d0d8938731f36b0248062af6114f6aa00e8d50ddf0e01f59583a11423ddaff548fcb1a80a9d205bb58cde30c810a5e52bf69cc220
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .ruby-version
11
+ *.gem
12
+ coverage
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1,8 @@
1
+ LineLength:
2
+ Enabled: false
3
+
4
+ Style/ClassAndModuleChildren:
5
+ Enabled: false
6
+
7
+ Documentation:
8
+ Enabled: false
@@ -0,0 +1,18 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 1.9.3-p551
5
+ - 2.0.0-p648
6
+ - 2.1.9
7
+ - 2.2.5
8
+ - 2.3.1
9
+ matrix:
10
+ allow_failures:
11
+ - rvm: 1.9.3-p551
12
+ - rvm: 2.0.0-p648
13
+ fast_finish: true
14
+ before_install: gem update --remote bundler
15
+ install:
16
+ - bundle install --retry=3
17
+ script:
18
+ - bundle exec rake build
@@ -1,70 +1,70 @@
1
1
  # 2013-April
2
2
 
3
3
  0.0.10: 2013-04-26
4
-
4
+
5
5
  Initial release of code into RubyGems. Code tested on EX and SRX-branch. Consider this code
6
6
  as "early-adopter". Comments/feedback is welcome and appreciated.
7
7
 
8
8
  0.0.11: 2013-04-26
9
-
9
+
10
10
  Updated Junos::Ez::RE::Utils
11
11
  #memory changed :procs from Hash to Array
12
12
  #users changed return from Hash to Array
13
-
13
+
14
14
  0.0.12: 2013-04-26
15
-
15
+
16
16
  Updated Junos::Ez::FS:Utils#ls to include :symlink information
17
17
  Adding Junos::Ez::Users::Provider for login management
18
18
  Adding Junos::Ez::UserAuths::Provider for SSH-key management
19
-
19
+
20
20
  0.0.14: 2013-04-28
21
-
21
+
22
22
  Completed initial documentation. Still more work to be done with these files
23
23
  but the "enough to get started" information is now available
24
-
24
+
25
25
  # 2013-May
26
26
 
27
27
  0.0.15: 2013-05-02
28
-
28
+
29
29
  L2ports - added support for framework to read [edit vlans] stanza to recognize interfaces configured
30
30
  there vs. under [edit interfaces]
31
-
31
+
32
32
  IPports - added :acl_in and :acl_out for stateless ACL filtering. added .status method to return
33
33
  runtime status information about the port
34
-
34
+
35
35
  RE::Utils - misc updates, and documentation
36
36
 
37
37
  0.0.16: 2013-05-03
38
-
38
+
39
39
  RE::Utils - added support for license-key management. Renamed "software" methods from "xxx_software"
40
40
  to "software_xxx" to be consistent with other naming usage. Updated docs.
41
-
41
+
42
42
  0.0.17: 2013-05-05
43
-
43
+
44
44
  FS::Utils - updated docs. fixed methods so that all "error" scenarios raise IOError excaptions.
45
-
45
+
46
46
  0.1.0: 2013-05-06
47
-
47
+
48
48
  All docs and code _finished_ for the inital release of code. Always more to do, but at this
49
49
  point, declaring the framework "good for early adopter testing". Looking forward to bug-reports,
50
50
  please open issues against this repo. Thank you!
51
-
51
+
52
52
  0.1.1: 2013-05-29
53
-
53
+
54
54
  Fixed a small bug in fact gathering for hardwaremodel
55
-
55
+
56
56
  # 2013-July
57
57
 
58
58
  0.1.2: 2013-07-04
59
-
59
+
60
60
  Fixed issue#3. Previously this gem would not work with non-VC capable EX switches. Updated
61
61
  the `facts/version.rb` file to handle these devices. Also added a new fact `:vc_capable` that
62
62
  is set to `true` if the EX can support virtual-chassis, and `false` if it cannot.
63
63
 
64
64
  # 2013-Aug
65
65
 
66
- 0.2.0:
67
-
66
+ 0.2.0:
67
+
68
68
  Fixed issue #6. Added support for EX4300 platform. Added new provider for Link Aggregation Group
69
69
  resources (LAGports)
70
70
 
@@ -89,3 +89,15 @@
89
89
  Enhancement
90
90
  * Add support for configuring l2_interface on MX device.
91
91
  * Add support for provider 'group' for configuring JUNOS groups.
92
+
93
+ # 2016-August
94
+
95
+ 1.0.3
96
+ Fixed issues
97
+ Issue #46 Removing references to rake from gemspec
98
+ Issue #47 cannot get the git source code
99
+
100
+ Enhancement
101
+ * Valid project metadata and rake for cleanly building/releasing
102
+ * Test hooks and badges
103
+ * netconf gem pessimistic version constraint to 0.3.1
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ gem 'simplecov', require: false, group: :test
data/README.md CHANGED
@@ -1,11 +1,14 @@
1
+ [![Gem Version](https://badge.fury.io/rb/junos-ez-stdlib.svg)](https://badge.fury.io/rb/junos-ez-stdlib)[![Dependency Status](https://gemnasium.com/badges/github.com/Juniper/ruby-junos-ez-stdlib.svg)](https://gemnasium.com/github.com/Juniper/ruby-junos-ez-stdlib)
2
+ [![Build Status](https://travis-ci.org/Juniper/ruby-junos-ez-stdlib.svg?branch=master)](https://travis-ci.org/Juniper/ruby-junos-ez-stdlib)
3
+
1
4
  # OVERVIEW
2
5
 
3
6
  Ruby framework to support Junos OS based device management automation.
4
7
 
5
8
  This is the "standard library" or "core" set of functionality that should work on most/all Junos OS based devices.
6
9
 
7
- This framework is build on top of the NETCONF gem which uses XML as the fundamental data-exchange. So no
8
- "automating the CLI" or using SNMP. The purpose of this framework is to **enable automation development
10
+ This framework is build on top of the NETCONF gem which uses XML as the fundamental data-exchange. So no
11
+ "automating the CLI" or using SNMP. The purpose of this framework is to **enable automation development
9
12
  without requiring specific Junos XML knowledge**.
10
13
 
11
14
  Further documentation can be found in the *docs* subdirectory.
@@ -14,32 +17,32 @@ Further documentation can be found in the *docs* subdirectory.
14
17
 
15
18
  The framework is comprised of these basic eloements:
16
19
 
17
- - Facts:
20
+ - Facts:
18
21
 
19
22
  A Hash of name/value pairs of information auto-collected. Fact values can be Hash structures as well
20
23
  so you can have deeply nested fact data. You can also define your own facts in addition to the "stdlib" facts.
21
24
  The facts are used by the framework to create a platform indepent layer of abstraction. This means
22
25
  that managing a VLAN, for example, is the same regardless of the underlying hardware platofrm (EX, QFX,
23
26
  MX, SRX, ...)
24
-
25
- - Resources:
26
27
 
27
- Resources allow you to easily configure and perform operational functions on specific items within Junos,
28
+ - Resources:
29
+
30
+ Resources allow you to easily configure and perform operational functions on specific items within Junos,
28
31
  for example VLANs, or switch ports. A resource has *properties* that you manipuate as Hash. You can
29
- interact with Junos using resource methods like `read!`, `write!`, `delete!`, `activate!`, `deactivate!`, etc.
32
+ interact with Junos using resource methods like `read!`, `write!`, `delete!`, `activate!`, `deactivate!`, etc.
30
33
  For a complete listing of resource methods, refer to the *docs* directory
31
-
34
+
32
35
  - Providers:
33
36
 
34
37
  Providers allow you to manage a collection of resource, and most commonly, select a resource.
35
38
  The purpose of a provider/resource is to automate the life-cycle of common changes, like adding
36
- VLANs, or ports to a VLAN. A provider also allows you to obtain a `list` of resources
37
- (Array of *names*) or a `catalog` (Hash of resource properties). Providers may include resource
38
- specific functionality, like using complex YAML/Hash data for easy import/export and provisioning
39
+ VLANs, or ports to a VLAN. A provider also allows you to obtain a `list` of resources
40
+ (Array of *names*) or a `catalog` (Hash of resource properties). Providers may include resource
41
+ specific functionality, like using complex YAML/Hash data for easy import/export and provisioning
39
42
  with Junos. If you need the ability to simply apply config-snippets that you do not need to model
40
- as resources (as you might for initial device commissioning), the Utilities library is where you
43
+ as resources (as you might for initial device commissioning), the Utilities library is where you
41
44
  want to start.
42
-
45
+
43
46
  - Utilities:
44
47
 
45
48
  Utilities are simply collections of functions. The **configuration** utilities, for example, will
@@ -47,9 +50,9 @@ The framework is comprised of these basic eloements:
47
50
  for unmanaged provider/resources (like initial configuration of the device). The
48
51
  **routing-engine** utilities, for example, will allow you to easily upgrade software, check
49
52
  memory usage, and do `ping` operations.
50
-
53
+
51
54
  # EXAMPLE USAGE
52
-
55
+
53
56
  ```ruby
54
57
  require 'pp'
55
58
  require 'net/netconf/jnpr'
@@ -60,7 +63,7 @@ unless ARGV[0]
60
63
  exit 1
61
64
  end
62
65
 
63
- # login information for NETCONF session
66
+ # login information for NETCONF session
64
67
  login = { :target => ARGV[0], :username => 'jeremy', :password => 'jeremy1', }
65
68
 
66
69
  ## create a NETCONF object to manage the device and open the connection ...
@@ -71,8 +74,8 @@ ndev.open
71
74
  puts "OK!"
72
75
 
73
76
  ## Now bind providers to the device object. The 'Junos::Ez::Provider' must be first.
74
- ## This will retrieve the device 'facts'. The other providers allow you to define the
75
- ## provider variables; so this example is using 'l1_ports' and 'ip_ports', but you could name
77
+ ## This will retrieve the device 'facts'. The other providers allow you to define the
78
+ ## provider variables; so this example is using 'l1_ports' and 'ip_ports', but you could name
76
79
  ## them what you like, yo!
77
80
 
78
81
  Junos::Ez::Provider( ndev )
@@ -125,7 +128,7 @@ ndev.cu.rollback!
125
128
 
126
129
  ndev.close
127
130
  ```
128
-
131
+
129
132
  # PROVIDERS
130
133
 
131
134
  Providers manage access to individual resources and their associated properties. Providers/resources exists
@@ -137,30 +140,30 @@ documentation on Providers/Resources, see the *docs* directory.
137
140
  - Vlans: VLAN resource management
138
141
  - IPports: IP v4 port management
139
142
  - StaticHosts: Static Hosts [system static-host-mapping ...]
140
- - StaticRoutes: Static Routes [routing-options static ...]
141
- - Group: JUNOS groups management
143
+ - StaticRoutes: Static Routes [routing-options static ...]
144
+ - Group: JUNOS groups management
142
145
 
143
146
  # UTILITIES
144
147
 
145
148
  - Config:
146
-
149
+
147
150
  These functions allow you to load config snippets, do commit checks, look at config diffs, etc.
148
- Generally speaking, you would want to use the Providers/Resources framework to manage specific
151
+ Generally speaking, you would want to use the Providers/Resources framework to manage specific
149
152
  items in the config. This utility library is very useful when doing the initial commissioning
150
153
  process, where you do not (cannot) model every aspect of Junos. These utilities can also be
151
154
  used in conjunction with Providers/Resources, specifically around locking/unlocking and committing
152
155
  the configuration.
153
-
156
+
154
157
  - Filesystem:
155
-
158
+
156
159
  These functions provide you "unix-like" commands that return data in Hash forms rather than
157
160
  as string output you'd normally have to screen-scraps. These methods include `ls`, `df`, `pwd`,
158
161
  `cwd`, `cleanup`, and `cleanup!`
159
162
 
160
163
  - Routing-Engine:
161
-
162
- These functions provide a general collection to information and functioanlity for handling
163
- routing-engine (RE) processes. These functions `reboot!`, `shutdown!`, `install_software!`,
164
+
165
+ These functions provide a general collection to information and functioanlity for handling
166
+ routing-engine (RE) processes. These functions `reboot!`, `shutdown!`, `install_software!`,
164
167
  `ping`. Information gathering such as memory-usage, current users, and RE status information
165
168
  is also made available through this collection.
166
169
 
@@ -168,19 +171,19 @@ documentation on Providers/Resources, see the *docs* directory.
168
171
 
169
172
  * gem netconf
170
173
  * Junos OS based products
171
-
172
- # INSTALLATION
174
+
175
+ # INSTALLATION
173
176
 
174
177
  * gem install junos-ez-stdlib
175
178
 
176
179
  # CONTRIBUTORS
177
- Juniper Networks is actively contributing to and maintaining this repo. Please contact jnpr-community-netdev@juniper.net
180
+ Juniper Networks is actively contributing to and maintaining this repo. Please contact jnpr-community-netdev@juniper.net
178
181
  for any queries.
179
-
182
+
180
183
  Contributors:
181
184
  [John Deatherage](https://github.com/routelastresort), [Nitin Kumar](https://github.com/vnitinv),
182
- [Priyal Jain](https://github.com/jainpriyal), [Ganesh Nalawade](https://github.com/ganeshnalawade)
183
-
185
+ [Priyal Jain](https://github.com/jainpriyal), [Ganesh Nalawade](https://github.com/ganeshrn)
186
+
184
187
  Former Contributors:
185
188
  [Jeremy Schulman](https://github.com/jeremyschulman)
186
189
 
@@ -0,0 +1,6 @@
1
+ require 'bundler/gem_tasks'
2
+ require 'rspec/core/rake_task'
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -0,0 +1,32 @@
1
+ # PLEASE CONTRIBUTE
2
+
3
+ ## IDEAS & SUGGESTIONS
4
+
5
+ If you have a suggestion or idea, please write it up as a separate file and do a *pull request*. Your file will be added to this directory as a separate file so folks can peer-review and crowdsource around it.
6
+
7
+ It would be helpful to include the following information in the file:
8
+
9
+ 1. SYNOPSIS - A brief statement of what is needed
10
+ 2. TARGET PLATFORMS - A list of Junos OS based platforms this would apply to
11
+ 3. TARGET RELEASE - If you have specific Junos OS release requirements, please state them
12
+ 4. TIMELINE - If you have a specific *gotta have it* by date, please let us know
13
+ 5. GORY DETAILS - Please provide as much information you can around the use-case or application
14
+
15
+ Please name your file in the following format:
16
+
17
+ <DATEYYMMDD>_<GITHUB-USER-HANDLE>_<IDEA-NAME>.md
18
+
19
+ For example, let's say I was going to submit something around virtual-routing (VRF), I would name the file:
20
+
21
+ 20130430_jeremyschulman_vrf.md
22
+
23
+ Thank you all for your support and contributions!
24
+
25
+ ## CODE & BUG-FIXES
26
+
27
+ Pull requests are welcome and appreciated !
28
+
29
+ # THANK YOU
30
+
31
+ This framework is built for the commmunity of DevOps and NetDevOps that need to create automation solutions. Your help and participation in the development of this software is essential
32
+
data/dev.yml ADDED
@@ -0,0 +1,6 @@
1
+ # This file is for shopify internal development, feel free to ignore.
2
+ name: ruby-junos-ez-stdlib
3
+
4
+ up:
5
+ - ruby: 2.5.3
6
+ - bundler
@@ -0,0 +1,129 @@
1
+ # sample contributed by "Maarten at the Amsterdam University of Applied Sciences", @289Sec
2
+ # slight mods by @nwkautomaniac
3
+
4
+ # Prefix-lists:
5
+ policy-options {
6
+ prefix-list dns-servers-ipv4 {
7
+ apply-path "system name-server <*.*>";
8
+ }
9
+ prefix-list ntp-servers-ipv4 {
10
+ apply-path "system ntp server <*.*>";
11
+ }
12
+ prefix-list snmp-client-systems-ipv4 {
13
+ apply-path "snmp client-list <*> <*.*>";
14
+ }
15
+ prefix-list tacacs-servers-ipv4 {
16
+ apply-path "system tacplus-server <*.*>";
17
+ }
18
+ prefix-list radius-servers-ipv4 {
19
+ apply-path "access radius-server <*.*>";
20
+ }
21
+ prefix-list management-networks-ipv4 {
22
+ 172.20.0.0/16;
23
+ 192.168.56.0/24;
24
+ }
25
+ }
26
+
27
+
28
+ # Firewall filter:
29
+ firewall {
30
+ family inet {
31
+ filter re-protect-ipv4 {
32
+ term discard-fragments-icmp {
33
+ from {
34
+ is-fragment;
35
+ protocol icmp;
36
+ }
37
+ then discard;
38
+ }
39
+ term icmp-allow {
40
+ from {
41
+ protocol icmp;
42
+ icmp-type [ echo-request echo-reply unreachable time-exceeded source-quench ];
43
+ }
44
+ then accept;
45
+ }
46
+ term dns-allow {
47
+ from {
48
+ source-prefix-list {
49
+ dns-servers-ipv4;
50
+ }
51
+ protocol [ udp tcp ]
52
+ source-port domain;
53
+ }
54
+ then accept;
55
+ }
56
+ term ntp-allow {
57
+ from {
58
+ source-prefix-list {
59
+ ntp-servers-ipv4;
60
+ }
61
+ protocol udp;
62
+ source-port ntp;
63
+ }
64
+ then accept;
65
+ }
66
+ term snmp-allow {
67
+ from {
68
+ source-prefix-list {
69
+ snmp-client-systems-ipv4;
70
+ }
71
+ protocol udp;
72
+ destination-port snmp;
73
+ }
74
+ then accept;
75
+ }
76
+ term tacacs-allow {
77
+ from {
78
+ source-prefix-list {
79
+ tacacs-servers-ipv4;
80
+ }
81
+ protocol tcp;
82
+ source-port tacacs;
83
+ }
84
+ then accept;
85
+ }
86
+ term radius-allow {
87
+ from {
88
+ source-prefix-list {
89
+ radius-servers-ipv4;
90
+ }
91
+ protocol udp;
92
+ source-port radius;
93
+ }
94
+ then accept;
95
+ }
96
+ term ssh-allow {
97
+ from {
98
+ source-prefix-list {
99
+ management-networks-ipv4;
100
+ }
101
+ protocol tcp;
102
+ destination-port ssh;
103
+ }
104
+ then {
105
+ accept;
106
+ }
107
+ }
108
+ term everything-else-discard {
109
+ then {
110
+ discard;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ }
116
+
117
+
118
+ # Interface configuration:
119
+ interfaces {
120
+ fe-0/0/0 {
121
+ unit 0 {
122
+ family inet {
123
+ filter {
124
+ input re-protect-ipv4;
125
+ }
126
+ }
127
+ }
128
+ }
129
+ }
@@ -0,0 +1,3 @@
1
+ set system host-name jeremy
2
+ set system domain-name foo.bar
3
+
@@ -0,0 +1,7 @@
1
+ interfaces {
2
+ <% interfaces.each do |ifd| %>
3
+ <%= ifd %> {
4
+ disable;
5
+ }
6
+ <% end %>
7
+ }
@@ -0,0 +1,7 @@
1
+ interfaces {
2
+ <% @interfaces.each do |ifd| %>
3
+ <%= ifd %> {
4
+ disable;
5
+ }
6
+ <% end %>
7
+ }
@@ -1,15 +1,26 @@
1
- $LOAD_PATH.unshift 'lib'
2
- require 'rake'
1
+ # frozen_string_literal: true
2
+ # coding: utf-8
3
+ lib = File.expand_path('../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
5
  require 'junos-ez/version'
4
6
 
5
- Gem::Specification.new do |s|
6
- s.name = 'shopify-junos-ez-stdlib'
7
- s.version = Junos::Ez::VERSION
8
- s.summary = "Junos EZ Framework - Standard Libraries"
9
- s.description = "Automation Framework for Junos/NETCONF: Facts, Providers, and Utils"
10
- s.homepage = 'https://github.com/Juniper/ruby-junos-ez-stdlib'
11
- s.authors = ["Jeremy Schulman", "John Deatherage", "Nitin Kumar", "Priyal Jain", "Ganesh Nalawade"]
12
- s.email = 'jnpr-community-netdev@juniper.net'
13
- s.files = FileList[ '*', 'lib/**/*.rb', 'examples/**/*.rb', 'docs/**/*.md' ]
14
- s.add_dependency('netconf', ">= 0.2.5")
7
+ Gem::Specification.new do |spec|
8
+ spec.name = 'shopify-junos-ez-stdlib'
9
+ spec.version = Junos::Ez::VERSION
10
+ spec.authors = ['Jeremy Schulman', 'John Deatherage', 'Nitin Kumar', 'Priyal Jain', 'Ganesh Nalawade']
11
+ spec.email = 'jnpr-community-netdev@juniper.net'
12
+
13
+ spec.summary = 'Junos EZ Framework - Standard Libraries'
14
+ spec.description = 'Automation Framework for Junos/NETCONF: Facts, Providers, and Utils'
15
+ spec.homepage = 'https://github.com/Juniper/ruby-junos-ez-stdlib'
16
+ spec.license = 'BSD-2-Clause'
17
+
18
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
19
+
20
+ spec.add_dependency('netconf', '~> 0.3.1')
21
+
22
+ spec.add_development_dependency 'bundler', '~> 2.0.2'
23
+ spec.add_development_dependency 'rake', '~> 10.0'
24
+ spec.add_development_dependency 'rspec', '~> 3.0'
25
+ spec.add_development_dependency 'rubocop', '~> 0.49.0'
15
26
  end
@@ -6,7 +6,7 @@ Junos::Ez::Facts::Keeper.define( :personality ) do |ndev, facts|
6
6
  examine = ( model != "Virtual Chassis" ) ? model : facts.select {|k,v| k.match(/^RE[0..9]+/) }.values[0][:model]
7
7
 
8
8
  facts[:personality] = case examine
9
- when /^(EX)|(QFX)|(OCX)/i
9
+ when /^(EX)|(QFX)|(PTX)|(OCX)/i
10
10
  :SWITCH
11
11
  when /^MX/i
12
12
  :MX
@@ -43,6 +43,7 @@ Junos::Ez::Facts::Keeper.define( :version ) do |ndev, facts|
43
43
  unless master_id.nil?
44
44
  facts[:version] =
45
45
  facts[("version_" + "RE" + master_id).to_sym] ||
46
+ facts[("version_" + "LOCALRE").to_sym] ||
46
47
  facts[('version_' + "FPC" + master_id).to_sym]
47
48
  end
48
49
  else
@@ -169,7 +169,7 @@ class Junos::Ez::Config::Provider < Junos::Ez::Provider::Parent
169
169
 
170
170
  def diff?( rollback_id = 0 )
171
171
  raise ArgumentError, "invalid rollback #{rollback_id}" unless ( rollback_id >= 0 and rollback_id <= 50 )
172
- got = ndev.rpc.get_configuration( :compare=>'rollback', :rollback=> rollback_id.to_s )
172
+ got = ndev.rpc.get_configuration( :compare => 'rollback', :rollback => rollback_id.to_s, :format => 'text' )
173
173
  diff = got.xpath('configuration-output').text
174
174
  return nil if diff == "\n"
175
175
  diff
@@ -1,6 +1,6 @@
1
1
  module Junos; end
2
2
  module Junos::Ez; end
3
-
3
+
4
4
  module Junos::Ez
5
- VERSION = "1.0.0"
5
+ VERSION = '1.0.3'.freeze
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-junos-ez-stdlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Schulman
@@ -12,31 +12,95 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2016-05-03 00:00:00.000000000 Z
15
+ date: 2019-10-03 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: netconf
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ">="
21
+ - - "~>"
22
22
  - !ruby/object:Gem::Version
23
- version: 0.2.5
23
+ version: 0.3.1
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - ">="
28
+ - - "~>"
29
29
  - !ruby/object:Gem::Version
30
- version: 0.2.5
30
+ version: 0.3.1
31
+ - !ruby/object:Gem::Dependency
32
+ name: bundler
33
+ requirement: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - "~>"
36
+ - !ruby/object:Gem::Version
37
+ version: 2.0.2
38
+ type: :development
39
+ prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ requirements:
42
+ - - "~>"
43
+ - !ruby/object:Gem::Version
44
+ version: 2.0.2
45
+ - !ruby/object:Gem::Dependency
46
+ name: rake
47
+ requirement: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - "~>"
50
+ - !ruby/object:Gem::Version
51
+ version: '10.0'
52
+ type: :development
53
+ prerelease: false
54
+ version_requirements: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - "~>"
57
+ - !ruby/object:Gem::Version
58
+ version: '10.0'
59
+ - !ruby/object:Gem::Dependency
60
+ name: rspec
61
+ requirement: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - "~>"
64
+ - !ruby/object:Gem::Version
65
+ version: '3.0'
66
+ type: :development
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '3.0'
73
+ - !ruby/object:Gem::Dependency
74
+ name: rubocop
75
+ requirement: !ruby/object:Gem::Requirement
76
+ requirements:
77
+ - - "~>"
78
+ - !ruby/object:Gem::Version
79
+ version: 0.49.0
80
+ type: :development
81
+ prerelease: false
82
+ version_requirements: !ruby/object:Gem::Requirement
83
+ requirements:
84
+ - - "~>"
85
+ - !ruby/object:Gem::Version
86
+ version: 0.49.0
31
87
  description: 'Automation Framework for Junos/NETCONF: Facts, Providers, and Utils'
32
88
  email: jnpr-community-netdev@juniper.net
33
89
  executables: []
34
90
  extensions: []
35
91
  extra_rdoc_files: []
36
92
  files:
93
+ - ".gitignore"
94
+ - ".rspec"
95
+ - ".rubocop.yml"
96
+ - ".travis.yml"
37
97
  - CHANGELOG.md
98
+ - Gemfile
38
99
  - LICENSE
39
100
  - README.md
101
+ - Rakefile
102
+ - SUGGESTION-BOX/README.md
103
+ - dev.yml
40
104
  - docs/Facts.md
41
105
  - docs/Providers/Group.md
42
106
  - docs/Providers/IPports.md
@@ -57,6 +121,10 @@ files:
57
121
  - examples/config/config_file.rb
58
122
  - examples/config/config_template_object.rb
59
123
  - examples/config/config_template_simple.rb
124
+ - examples/config/load_sample.conf
125
+ - examples/config/load_sample.set
126
+ - examples/config/load_template_main.conf
127
+ - examples/config/load_template_object.conf
60
128
  - examples/config/multi_config.rb
61
129
  - examples/fs_utils.rb
62
130
  - examples/lag_port.rb
@@ -101,10 +169,9 @@ files:
101
169
  - lib/junos-ez/vlans/bridge_domain.rb
102
170
  - lib/junos-ez/vlans/vlan.rb
103
171
  - lib/junos-ez/vlans/vlan_l2ng.rb
104
- - shipit.yml
105
- - tmp
106
172
  homepage: https://github.com/Juniper/ruby-junos-ez-stdlib
107
- licenses: []
173
+ licenses:
174
+ - BSD-2-Clause
108
175
  metadata: {}
109
176
  post_install_message:
110
177
  rdoc_options: []
@@ -121,8 +188,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
121
188
  - !ruby/object:Gem::Version
122
189
  version: '0'
123
190
  requirements: []
124
- rubyforge_project:
125
- rubygems_version: 2.4.5.1
191
+ rubygems_version: 3.0.3
126
192
  signing_key:
127
193
  specification_version: 4
128
194
  summary: Junos EZ Framework - Standard Libraries
data/shipit.yml DELETED
@@ -1,4 +0,0 @@
1
- deploy:
2
- override:
3
- - rake build
4
- - package_cloud push shopify/prodeng-gems pkg/ruby-junos-ez-stdlib-*.gem
data/tmp DELETED
@@ -1,7 +0,0 @@
1
-
2
-
3
- [1,2,3,4,5].each do |num|
4
- list << num
5
- end
6
-
7
- puts list