foreman_virt_who_configure 0.1.2 → 0.1.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
2
  SHA1:
3
- metadata.gz: ee4227e4992392c6e28c5c78d67767da1b848d8f
4
- data.tar.gz: 979259473442e7970dd08a06749b444eedde82cd
3
+ metadata.gz: 2008ae4faa3e226b92f38e622d36336c9c41ab6d
4
+ data.tar.gz: 19a345a6b897f6316d4246ac3d27d062e8e11064
5
5
  SHA512:
6
- metadata.gz: a99643747882bac9738c17cfabc6aab51e7e61e32e4c318f7942cb64009151bb4e0be21b4cef3f354c1e558c34f26be93e1901bc706bba72500656ce80194878
7
- data.tar.gz: 18481a8b5857bdf33cc67b3f43d5af1607ff79d38d810db32d0936b24ff992dd9ff96264e69788a880fbf528064767fbae050fb24032988b14da6ba930c74716
6
+ metadata.gz: fba16d9169161c00450b0d3247552e68a5b103192c1eef0be6a36c77e6d9658b942646e8edc1b6225a737c1fa5a6c54c7780d9857d5d35a8ef5f69f3b3600acd
7
+ data.tar.gz: dfa23ba31cc18e7a0eeba914cca88fff1e7ab42d8620279848c933037fd7986cfbbf88ade145aa61e8ee2b7531d1b48857c62d52ac329cb20de4d3f11bf8bbdf
@@ -2,6 +2,7 @@ pre.terminal {
2
2
  display: block;
3
3
  padding: 9.5px;
4
4
  margin: 0 0 10px;
5
+ max-height: 300px;
5
6
  font-size: 12px;
6
7
  word-break: break-all;
7
8
  word-wrap: break-word;
@@ -11,3 +12,6 @@ pre.terminal {
11
12
  border-radius: 0px;
12
13
  font-family: Menlo, Monaco, Consolas, monospace;
13
14
  }
15
+ .terminal-buttons {
16
+ margin-bottom: 10px;
17
+ }
@@ -88,9 +88,10 @@ module ForemanVirtWhoConfigure
88
88
  after_create :create_service_user
89
89
  after_destroy :destroy_service_user
90
90
 
91
- validates :interval, :hypervisor_type, :hypervisor_server, :hypervisor_username, :hypervisor_password,
91
+ validates :interval, :hypervisor_type, :hypervisor_server, :hypervisor_username,
92
92
  :satellite_url, :hypervisor_id, :organization_id, :name,
93
93
  :presence => true
94
+ validates :hypervisor_password, :presence => true, :if => Proc.new { |c| c.hypervisor_type != 'libvirt' }
94
95
  validates :hypervisor_type, :inclusion => HYPERVISOR_TYPES.keys
95
96
  validates :hypervisor_id, :inclusion => HYPERVISOR_IDS
96
97
  validates :interval, :inclusion => AVAILABLE_INTERVALS.keys.map(&:to_i)
@@ -182,6 +183,10 @@ module ForemanVirtWhoConfigure
182
183
  end
183
184
  end
184
185
 
186
+ def virt_who_config_command
187
+ "hammer virt-who-config deploy --id #{self.id}"
188
+ end
189
+
185
190
  def virt_who_touch!
186
191
  self.last_report_at = DateTime.now.utc
187
192
  self.out_of_date_at = self.last_report_at + self.interval.minutes
@@ -5,7 +5,41 @@
5
5
  <div class="form-group">
6
6
  <div class="row">
7
7
  <div class="col-md-12">
8
- <label><%= _("To deploy this configuration. run this script on the target host which has access to Red Hat Satellite Tools repository and will run virt-who reporting, preferably Satellite host:") %></label>
8
+ <h1><%= _("Virt-who Configuration %s") % @config.name %></h1>
9
+ </div>
10
+ <div class="col-md-6">
11
+ <%= _("Use either hammer command or the script below to deploy this configuration. Run one of them on the target host which has access to Red Hat Satellite Tools repository and will run virt-who reporting, preferably Satellite host:") %>
12
+ </div>
13
+ <div class="col-md-2">
14
+ <div class="pull-right">
15
+ <p>
16
+ <%= link_to _('Edit this configuration'), edit_foreman_virt_who_configure_config_path(@config), :class => 'btn btn-default' %>
17
+ </p>
18
+ </div>
19
+ </div>
20
+ </div>
21
+
22
+ <div class="row">
23
+ <div class="col-md-12">
24
+ <h2><%= 'a) ' + _('Hammer command: ') %></h2>
25
+ </div>
26
+ </div>
27
+ <div class="row">
28
+ <div class="col-md-8">
29
+ <pre class="terminal" id="config_command"><%= @config.virt_who_config_command %></pre>
30
+ </div>
31
+ <div class="col-md-8">
32
+ <div class="terminal-buttons">
33
+ <%= link_to _('Copy to clipboard'), nil, :class => 'btn btn-default', :onclick => 'virt_who_copy_configuration_to_clipboard($("#config_command").html())' %>
34
+ </div>
35
+ </div>
36
+ </div>
37
+
38
+ <div class="row">
39
+ <div class="col-md-12">
40
+ <h2><%= 'b) ' + _('Configuration script: ') %></h2>
41
+ </div>
42
+ <div class="col-md-8">
9
43
  <p>
10
44
  <%= _("On the target virt-who host:") %></br>
11
45
  <%= _("1. Copy this configuration script to a safe directory.") %></br>
@@ -14,17 +48,15 @@
14
48
  </p>
15
49
  </div>
16
50
  </div>
17
-
18
51
  <div class="row">
19
52
  <div class="col-md-8">
20
- <div class="pull-right">
21
- <%= link_to _('Edit this configuration'), edit_foreman_virt_who_configure_config_path(@config), :class => 'btn btn-default' %>
53
+ <pre class="terminal" id="config_script"><%= @config.virt_who_config_script %></pre>
54
+ </div>
55
+ <div class="col-md-8">
56
+ <div class="terminal-buttons">
57
+ <%= link_to _('Copy to clipboard'), nil, :class => 'btn btn-default', :onclick => 'virt_who_copy_configuration_to_clipboard($("#config_script").html())' %>
22
58
  <%= link_to _('Download the script'), deploy_script_foreman_virt_who_configure_config_path(@config), :class => 'btn btn-default' %>
23
- <%= link_to _('Copy to clipboard'), nil, :class => 'btn btn-default', :onclick => 'virt_who_copy_configuration_to_clipboard($("pre.terminal").html())' %>
24
59
  </div>
25
-
26
- <h3><%= _('Configuration script: ') %></h3>
27
- <pre class="terminal"><%= @config.virt_who_config_script %></pre>
28
60
  </div>
29
61
  </div>
30
62
  </div>
@@ -1,3 +1,3 @@
1
1
  module ForemanVirtWhoConfigure
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_virt_who_configure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman virt-who-configure team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-02 00:00:00.000000000 Z
11
+ date: 2017-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello