rethtool 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.3
1
+ 0.0.4
@@ -36,6 +36,7 @@ class Rethtool::InterfaceSettings
36
36
  # Create a new InterfaceSettings object. Simply pass it the name of the
37
37
  # interface you want to get the settings for.
38
38
  def initialize(interface)
39
+ @interface = interface
39
40
  cmd = Rethtool::EthtoolCmd.new
40
41
  cmd.cmd = Rethtool::ETHTOOL_CMD_GSET
41
42
 
@@ -88,6 +89,14 @@ class Rethtool::InterfaceSettings
88
89
  best_speed = modes.map { |m| m.speed }.sort.last
89
90
  high_speed_modes = modes.find_all { |m| m.speed == best_speed }
90
91
 
92
+ # Somewhere recently, RHEL decided to release a kernel or libc update
93
+ # that changes the behaviour of the ethtool ioctl so that instead of
94
+ # returning EOPNOTSUPP when you ask for available speeds on an interface
95
+ # that doesn't support that (like bonded NICs), it now returns success with
96
+ # an empty list. WHO DOES THAT SORT OF SHIT?!? So we've got to fake it
97
+ # ourselves.
98
+ raise Errno::EOPNOTSUPP.new("#{@interface} doesn't support enumerating speed modes") if modes.empty?
99
+
91
100
  if high_speed_modes.length == 0
92
101
  raise RuntimeError.new("Can't happen: no modes with the best speed?!?")
93
102
  elsif high_speed_modes.length == 1
metadata CHANGED
@@ -1,142 +1,123 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: rethtool
3
- version: !ruby/object:Gem::Version
4
- hash: 25
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 3
10
- version: 0.0.3
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Matt Palmer
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-01-28 00:00:00 Z
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
21
- version_requirements: &id001 !ruby/object:Gem::Requirement
12
+ date: 2014-01-16 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: cstruct
16
+ requirement: !ruby/object:Gem::Requirement
22
17
  none: false
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- hash: 3
27
- segments:
28
- - 0
29
- version: "0"
30
- requirement: *id001
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
31
22
  type: :runtime
32
23
  prerelease: false
33
- name: cstruct
34
- - !ruby/object:Gem::Dependency
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
24
+ version_requirements: !ruby/object:Gem::Requirement
36
25
  none: false
37
- requirements:
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ - !ruby/object:Gem::Dependency
31
+ name: rake
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
38
35
  - - ~>
39
- - !ruby/object:Gem::Version
40
- hash: 15
41
- segments:
42
- - 1
43
- - 6
44
- - 0
45
- version: 1.6.0
46
- requirement: *id002
36
+ - !ruby/object:Gem::Version
37
+ version: '10.0'
47
38
  type: :development
48
39
  prerelease: false
49
- name: jeweler
50
- - !ruby/object:Gem::Dependency
51
- version_requirements: &id003 !ruby/object:Gem::Requirement
40
+ version_requirements: !ruby/object:Gem::Requirement
52
41
  none: false
53
- requirements:
42
+ requirements:
54
43
  - - ~>
55
- - !ruby/object:Gem::Version
56
- hash: 23
57
- segments:
58
- - 1
59
- - 0
60
- - 0
61
- version: 1.0.0
62
- requirement: *id003
63
- type: :development
64
- prerelease: false
44
+ - !ruby/object:Gem::Version
45
+ version: '10.0'
46
+ - !ruby/object:Gem::Dependency
65
47
  name: bundler
66
- - !ruby/object:Gem::Dependency
67
- version_requirements: &id004 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
68
49
  none: false
69
- requirements:
50
+ requirements:
70
51
  - - ~>
71
- - !ruby/object:Gem::Version
72
- hash: 27
73
- segments:
74
- - 2
75
- - 4
76
- - 2
77
- version: 2.4.2
78
- requirement: *id004
52
+ - !ruby/object:Gem::Version
53
+ version: '1.0'
79
54
  type: :development
80
55
  prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ version: '1.0'
62
+ - !ruby/object:Gem::Dependency
81
63
  name: rdoc
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ~>
68
+ - !ruby/object:Gem::Version
69
+ version: '2.4'
70
+ type: :development
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ version: '2.4'
82
78
  description:
83
- email: mpalmer@hezmatt.org
79
+ email: theshed+rethtool@hezmatt.org
84
80
  executables: []
85
-
86
81
  extensions: []
87
-
88
- extra_rdoc_files:
82
+ extra_rdoc_files:
89
83
  - LICENSE.txt
90
84
  - README.rdoc
91
- files:
92
- - .document
85
+ files:
93
86
  - COPYING
94
- - Gemfile
95
- - Gemfile.lock
96
87
  - LICENSE.txt
97
88
  - README.rdoc
98
- - Rakefile
99
89
  - VERSION
100
90
  - lib/rethtool.rb
101
91
  - lib/rethtool/ethtool_cmd.rb
102
92
  - lib/rethtool/ethtool_value.rb
103
93
  - lib/rethtool/interface_settings.rb
104
94
  - lib/rethtool/link_status.rb
105
- - rethtool.gemspec
106
- - test/helper.rb
107
- - test/test_rethtool.rb
108
95
  homepage: http://theshed.hezmatt.org/rethtool
109
- licenses:
96
+ licenses:
110
97
  - GPLv3
111
98
  post_install_message:
112
99
  rdoc_options: []
113
-
114
- require_paths:
100
+ require_paths:
115
101
  - lib
116
- required_ruby_version: !ruby/object:Gem::Requirement
102
+ required_ruby_version: !ruby/object:Gem::Requirement
117
103
  none: false
118
- requirements:
119
- - - ">="
120
- - !ruby/object:Gem::Version
121
- hash: 3
122
- segments:
104
+ requirements:
105
+ - - ! '>='
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ segments:
123
109
  - 0
124
- version: "0"
125
- required_rubygems_version: !ruby/object:Gem::Requirement
110
+ hash: 3868727533372162074
111
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
112
  none: false
127
- requirements:
128
- - - ">="
129
- - !ruby/object:Gem::Version
130
- hash: 3
131
- segments:
132
- - 0
133
- version: "0"
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
134
117
  requirements: []
135
-
136
118
  rubyforge_project:
137
- rubygems_version: 1.8.24
119
+ rubygems_version: 1.8.23
138
120
  signing_key:
139
121
  specification_version: 3
140
122
  summary: Partial Ruby wrapper around the SIOCETHTOOL ioctl
141
123
  test_files: []
142
-
data/.document DELETED
@@ -1,5 +0,0 @@
1
- lib/**/*.rb
2
- bin/*
3
- -
4
- features/**/*.feature
5
- LICENSE.txt
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source "http://rubygems.org"
2
-
3
- gem "cstruct"
4
-
5
- group :development do
6
- gem "jeweler", "~> 1.6.0"
7
- gem "bundler", "~> 1.0.0"
8
- gem "rdoc", "~> 2.4.2"
9
- end
data/Gemfile.lock DELETED
@@ -1,20 +0,0 @@
1
- GEM
2
- remote: http://rubygems.org/
3
- specs:
4
- cstruct (1.0.0)
5
- git (1.2.5)
6
- jeweler (1.6.4)
7
- bundler (~> 1.0)
8
- git (>= 1.2.5)
9
- rake
10
- rake (0.9.2.2)
11
- rdoc (2.4.3)
12
-
13
- PLATFORMS
14
- ruby
15
-
16
- DEPENDENCIES
17
- bundler (~> 1.0.0)
18
- cstruct
19
- jeweler (~> 1.6.0)
20
- rdoc (~> 2.4.2)
data/Rakefile DELETED
@@ -1,44 +0,0 @@
1
- # encoding: utf-8
2
-
3
- require 'rubygems'
4
- require 'bundler'
5
- begin
6
- Bundler.setup(:default, :development)
7
- rescue Bundler::BundlerError => e
8
- $stderr.puts e.message
9
- $stderr.puts "Run `bundle install` to install missing gems"
10
- exit e.status_code
11
- end
12
- require 'rake'
13
-
14
- require 'jeweler'
15
- Jeweler::Tasks.new do |gem|
16
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
17
- gem.name = "rethtool"
18
- gem.homepage = "http://theshed.hezmatt.org/rethtool"
19
- gem.license = "GPLv3"
20
- gem.summary = %Q{Partial Ruby wrapper around the SIOCETHTOOL ioctl}
21
- gem.email = "mpalmer@hezmatt.org"
22
- gem.authors = ["Matt Palmer"]
23
- # dependencies defined in Gemfile
24
- end
25
- Jeweler::RubygemsDotOrgTasks.new
26
-
27
- require 'rake/testtask'
28
- Rake::TestTask.new(:test) do |test|
29
- test.libs << 'lib' << 'test'
30
- test.pattern = 'test/**/test_*.rb'
31
- test.verbose = true
32
- end
33
-
34
- task :default => :test
35
-
36
- require 'rdoc/task'
37
- Rake::RDocTask.new do |rdoc|
38
- version = File.exist?('VERSION') ? File.read('VERSION') : ""
39
-
40
- rdoc.rdoc_dir = 'rdoc'
41
- rdoc.title = "rethtool #{version}"
42
- rdoc.rdoc_files.include('README*')
43
- rdoc.rdoc_files.include('lib/**/*.rb')
44
- end
data/rethtool.gemspec DELETED
@@ -1,63 +0,0 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
5
-
6
- Gem::Specification.new do |s|
7
- s.name = "rethtool"
8
- s.version = "0.0.3"
9
-
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Matt Palmer"]
12
- s.date = "2013-01-28"
13
- s.email = "mpalmer@hezmatt.org"
14
- s.extra_rdoc_files = [
15
- "LICENSE.txt",
16
- "README.rdoc"
17
- ]
18
- s.files = [
19
- ".document",
20
- "COPYING",
21
- "Gemfile",
22
- "Gemfile.lock",
23
- "LICENSE.txt",
24
- "README.rdoc",
25
- "Rakefile",
26
- "VERSION",
27
- "lib/rethtool.rb",
28
- "lib/rethtool/ethtool_cmd.rb",
29
- "lib/rethtool/ethtool_value.rb",
30
- "lib/rethtool/interface_settings.rb",
31
- "lib/rethtool/link_status.rb",
32
- "rethtool.gemspec",
33
- "test/helper.rb",
34
- "test/test_rethtool.rb"
35
- ]
36
- s.homepage = "http://theshed.hezmatt.org/rethtool"
37
- s.licenses = ["GPLv3"]
38
- s.require_paths = ["lib"]
39
- s.rubygems_version = "1.8.24"
40
- s.summary = "Partial Ruby wrapper around the SIOCETHTOOL ioctl"
41
-
42
- if s.respond_to? :specification_version then
43
- s.specification_version = 3
44
-
45
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
46
- s.add_runtime_dependency(%q<cstruct>, [">= 0"])
47
- s.add_development_dependency(%q<jeweler>, ["~> 1.6.0"])
48
- s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
49
- s.add_development_dependency(%q<rdoc>, ["~> 2.4.2"])
50
- else
51
- s.add_dependency(%q<cstruct>, [">= 0"])
52
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
53
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
54
- s.add_dependency(%q<rdoc>, ["~> 2.4.2"])
55
- end
56
- else
57
- s.add_dependency(%q<cstruct>, [">= 0"])
58
- s.add_dependency(%q<jeweler>, ["~> 1.6.0"])
59
- s.add_dependency(%q<bundler>, ["~> 1.0.0"])
60
- s.add_dependency(%q<rdoc>, ["~> 2.4.2"])
61
- end
62
- end
63
-
data/test/helper.rb DELETED
@@ -1,18 +0,0 @@
1
- require 'rubygems'
2
- require 'bundler'
3
- begin
4
- Bundler.setup(:default, :development)
5
- rescue Bundler::BundlerError => e
6
- $stderr.puts e.message
7
- $stderr.puts "Run `bundle install` to install missing gems"
8
- exit e.status_code
9
- end
10
- require 'test/unit'
11
- require 'shoulda'
12
-
13
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
14
- $LOAD_PATH.unshift(File.dirname(__FILE__))
15
- require 'rethtool'
16
-
17
- class Test::Unit::TestCase
18
- end
@@ -1,7 +0,0 @@
1
- require 'helper'
2
-
3
- class TestRethtool < Test::Unit::TestCase
4
- should "probably rename this file and start testing for real" do
5
- flunk "hey buddy, you should probably rename this file and start testing for real"
6
- end
7
- end