foreman_m2 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a45c96c1764aa4113b86ee1ab5f72ad9c8e57e2a
4
- data.tar.gz: ee4cd3e255d92ccedbf8c211e8a177940cd73fc2
3
+ metadata.gz: 7eda017018d40b73148d7b05aaee1dc6c25eddd0
4
+ data.tar.gz: 5b7ba80ac06e7e0105031645a0991bc4d9c255b7
5
5
  SHA512:
6
- metadata.gz: 5416e32ad493c6b64a0faf170ed4572810fbedd6ccde955f1de8af61d9d9e36b20cb0636ab8ad2c6b558c4968cf7c7c700fe162066626f60b232345b92d8995e
7
- data.tar.gz: 306d823848be93bd604888ffa2be3a35dcf1c5889248173e2ae329a2f2ccbade678aab50ba68d897b493025d5627a7d4059790386b125e4215128eac9df60820
6
+ metadata.gz: a5000806742bad5274e479a175e8d653f9228cc1009ec57c8ba6b99b05f5275f7523e0ea59fbe9090696bac621c5c0eb80176897635294fcf6cb5dc6b8b344d8
7
+ data.tar.gz: ebf511961c43ff7603e4f0b55fc51bdecf2cf9536e0f508ebce488a5b9dc18ef8d65958ee11fc6cc2c39d821daa971a9f25f4d66a472863c28b468b558850a0b
data/README.md CHANGED
@@ -1,11 +1,12 @@
1
1
  # Foreman M2
2
2
 
3
- The Foreman M2 plugin introduces M2 functionality into Foreman. This is currently in-progress. Related: https://github.com/Izhmash/smart_proxy_m2
3
+ The Foreman M2 plugin introduces M2 functionality into Foreman. This is currently in-progress. Related: https://github.com/ianballou/smart_proxy_m2
4
4
 
5
5
  ## Pre-requirements
6
6
 
7
7
  - TFTP & DHCP servers
8
8
  - Smart-Proxy plugin that has M2 among its capabilities (see link above)
9
+ - Note: In 0.0.1, ensure that the M2 smart proxy is called "proxy_m2". This will be addressed in the next release.
9
10
  - Working M2 installation with images imported to the M2 project in use
10
11
 
11
12
  ## Installation
@@ -22,9 +23,15 @@ for how to install Foreman plugins
22
23
 
23
24
  ## TODO
24
25
 
26
+ - Query for M2 smart proxy by some method other than its name
27
+ - Fix will be out in next release
25
28
  - Testing
26
29
  - Disk management interface in Foreman
27
30
 
31
+ ## Known issues
32
+ - SSH orchestration attempts after host creation sometimes delay the generation of PXE boot files if there aren't enough server workers
33
+ - Try 5 workers
34
+
28
35
  ## Contributing
29
36
 
30
37
  Fork and send a Pull Request. Thanks!
@@ -10,7 +10,7 @@ module ForemanM2
10
10
  def new_action
11
11
  # automatically renders view/foreman_m2/hosts/new_action
12
12
 
13
- proxy = SmartProxy.find_by name: 'proxy_m2'
13
+ proxy = ::ProxyAPI::M2.new(url: SmartProxy.with_features('M2').first.url)
14
14
  proxyAPI = ::ProxyAPI::M2.new(url: proxy.url)
15
15
  @response = proxyAPI.get_images(:project => 'ian')
16
16
  @snaps = proxyAPI.get_snapshots(:project => 'ian')
@@ -9,9 +9,8 @@ module ForemanM2
9
9
  end
10
10
 
11
11
  def available_images
12
- proxy = SmartProxy.find_by name: 'proxy_m2'
12
+ proxy = SmartProxy.find_by url: self.url
13
13
  proxyAPI = ::ProxyAPI::M2.new(url: proxy.url)
14
- # proxy = ::ProxyAPI::M2.new(url: url)
15
14
  proxyAPI.get_images([])
16
15
  end
17
16
 
@@ -0,0 +1,4 @@
1
+ Deface::Override.new(:virtual_path => 'hosts/_form',
2
+ :name => 'remove_vm_tab',
3
+ :remove => 'li#compute_resource_tab')
4
+ #'erb[loud]:contains("select_f"):contains(":ptable_id")')
@@ -1,3 +1,3 @@
1
1
  module ForemanM2
2
- VERSION = '0.0.1'.freeze
2
+ VERSION = '0.0.2'.freeze
3
3
  end
@@ -0,0 +1,10 @@
1
+ FactoryBot.modify do
2
+ factory :compute_resource do
3
+ trait :m2 do
4
+ provider 'M2'
5
+ url 'http://127.0.0.1:1234'
6
+ end
7
+
8
+ #factory :m2_cr, :class => ForemanM2::M2, :traits => [:m2]
9
+ end
10
+ end
@@ -5,7 +5,12 @@ class ForemanM2Test < ActiveSupport::TestCase
5
5
  User.current = User.find_by login: 'admin'
6
6
  end
7
7
 
8
- test 'the truth' do
9
- assert true
8
+ test 'truth' do
9
+ assert_kind_of Module, ForemanM2
10
+ end
11
+
12
+ test 'proxy url saved in CR' do
13
+ m2 = FactoryBot.create(:compute_resource, :m2)
14
+ assert m2.url == 'http://127.0.0.1:1234'
10
15
  end
11
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_m2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Ballou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2018-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rdoc
@@ -74,6 +74,7 @@ files:
74
74
  - app/models/foreman_m2/m2.rb
75
75
  - app/overrides/give_ids.rb
76
76
  - app/overrides/hybrid_js.rb
77
+ - app/overrides/remove_vm_tab.rb
77
78
  - app/overrides/update_media_selection.rb
78
79
  - app/views/compute_resources/edit/_m2.html.erb
79
80
  - app/views/compute_resources/form/_m2.html.erb
@@ -103,6 +104,7 @@ files:
103
104
  - locale/en/foreman_m2.po
104
105
  - locale/foreman_m2.pot
105
106
  - locale/gemspec.rb
107
+ - test/factories/compute_resources.rb
106
108
  - test/factories/foreman_m2_factories.rb
107
109
  - test/test_plugin_helper.rb
108
110
  - test/unit/foreman_m2_test.rb
@@ -134,3 +136,4 @@ test_files:
134
136
  - test/test_plugin_helper.rb
135
137
  - test/unit/foreman_m2_test.rb
136
138
  - test/factories/foreman_m2_factories.rb
139
+ - test/factories/compute_resources.rb