foreman_xen 0.0.6 → 0.1.0

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: 8c4e90c0f194768e19271552a20bc354ba7ad4b0
4
- data.tar.gz: 4c83c3c6cefafa974ecb2138c731e3a4d363bcee
3
+ metadata.gz: 365378e8b9545f3690ba70b7a7330d0f1dbe4176
4
+ data.tar.gz: 8c78d3fc70a33a56f7440e41f8d712926c9024f5
5
5
  SHA512:
6
- metadata.gz: 02a09d2f06ac452c429d57292875b5d760d85df36629d98b617004cc8ba0e0163f7a294be1a2b2259acecd0ea581ee55bd9c3c62fa43a763d6700090ff12255b
7
- data.tar.gz: 30b1f01b2bea68a654157c5ee32fd437949d1cab40e319f36588d3aab81528f7fcdd235dfd0b831655a243695961af0e5eced28ee348a55ceb29779b8cdf7a64
6
+ metadata.gz: 0841e7a228fdd5d3a039f09b6cf0096f6dc8af84d3d5f1280fada29edd72047020742f49b02272c34fb1661456e7d0e1f6fa96e1d1040e190be9167912aa8c63
7
+ data.tar.gz: f6936add8819cafd4bbb862e9b77863fa9fec6babc338472f514109955a2a37bd4815e5829677cc79a7f312dbad45412c192e4f97f72af2639daa439c71fc5ec
data/README.md CHANGED
@@ -1,18 +1,21 @@
1
- # Development policy #
2
-
3
- Currently we hold master branch as tested and verified version, please submit your changes into development branch only.
4
-
5
1
  # Foreman XEN Plugin
6
2
 
7
3
  This plugin enables provisioning and managing XEN Server in Foreman.
8
4
 
9
5
  ## Installation
10
6
 
11
- Please see the Foreman manual for appropriate instructions:
7
+ Packages are available for Debian based distribtions as **ruby-foreman-xen** and for Red Hat based distributions as **ruby193-rubygem-foreman_xen** The gem name is **foreman_xen**.
8
+
9
+ Please see the Foreman manual for further instructions:
12
10
 
13
11
  * [Foreman: How to Install a Plugin](http://theforeman.org/manuals/latest/index.html#6.1InstallaPlugin)
14
12
 
15
- The gem name is "foreman_xen".
13
+ ## Compatibility
14
+
15
+ | Foreman Version | Plugin Version |
16
+ |:--------------- |:-------------- |
17
+ | >=1.5, <1.8 | 0.0.x |
18
+ | >=1.8.1 | 0.1.x |
16
19
 
17
20
  ## Special note
18
21
 
@@ -21,15 +24,9 @@ To make VNC client work properly, Foreman frontend should be configured without
21
24
  /usr/share/foreman/config/settings.yaml
22
25
  :require_ssl: false
23
26
 
24
- ## Compatibility
25
-
26
- | Foreman Version |
27
- | ---------------:|
28
- | >= 1.5 |
29
-
30
27
  ## Latest code
31
28
 
32
- You can get the develop branch of the plugin by specifying your Gemfile in this way:
29
+ You can get the latest development code of the plugin by specifying your Gemfile in this way:
33
30
 
34
31
  gem 'foreman_xen', :git => "https://github.com/theforeman/foreman-xen.git"
35
32
 
@@ -41,6 +41,14 @@ module FogExtensions
41
41
  _("%{cpus} CPUs and %{memory} memory") % {:cpus => vcpus_max, :memory => number_to_human_size(memory_max.to_i)}
42
42
  end
43
43
 
44
+ def interfaces
45
+ vifs
46
+ end
47
+
48
+ def select_nic(fog_nics, nic)
49
+ return fog_nics[0]
50
+ end
51
+
44
52
  end
45
53
  end
46
54
  end
@@ -1,59 +1,31 @@
1
1
  module ForemanXen
2
2
  module HostHelperExtensions
3
3
  extend ActiveSupport::Concern
4
- def host_title_actions(host)
5
- title_actions(
6
- button_group(
7
- link_to_if_authorized(_("Edit"), hash_for_edit_host_path(:id => host).merge(:auth_object => host),
8
- :title => _("Edit your host")),
9
- if host.build
10
- link_to_if_authorized(_("Cancel build"), hash_for_cancelBuild_host_path(:id => host).merge(:auth_object => host, :permission => 'build_hosts'),
11
- :disabled => host.can_be_built?,
12
- :title => _("Cancel build request for this host"))
13
- else
14
- link_to_if_authorized(_("Build"), hash_for_setBuild_host_path(:id => host).merge(:auth_object => host, :permission => 'build_hosts'),
15
- :disabled => !host.can_be_built?,
16
- :title => _("Enable rebuild on next host boot"),
17
- :confirm => _("Rebuild %s on next reboot?\nThis would also delete all of its current facts and reports") % host)
18
- end
19
- ),
20
- if host.compute_resource_id || host.bmc_available?
21
- button_group(
22
- link_to(_("Loading power state ..."), '#', :disabled => true, :id => :loading_power_state)
23
- )
24
- end,
25
- button_group(
26
- if host.try(:puppet_proxy)
27
- link_to_if_authorized(_("Run puppet"), hash_for_puppetrun_host_path(:id => host).merge(:auth_object => host, :permission => 'puppetrun_hosts'),
28
- :disabled => !Setting[:puppetrun],
29
- :title => _("Trigger a puppetrun on a node; requires that puppet run is enabled"))
30
- end
31
- ),
32
- button_group(
33
- link_to_if_authorized(_("Delete"), hash_for_host_path(:id => host).merge(:auth_object => host, :permission => 'destroy_hosts'),
34
- :class => "btn btn-danger", :confirm => _('Are you sure?'), :method => :delete)
35
- )
36
- )
37
- end
38
4
 
39
5
  def xen_host_title_actions(host)
40
6
  title_actions(
41
7
  button_group(
42
8
  link_to_if_authorized(_("Edit"), hash_for_edit_host_path(:id => host).merge(:auth_object => host),
43
- :title => _("Edit your host")),
44
- if host.compute_resource_id
9
+ :title => _("Edit your host"), :id => "edit-button"),
10
+ if not host.compute_resource.nil? and host.compute_resource.type =="ForemanXen::Xenserver"
45
11
  link_to(_("Snapshots"), "../foreman_xen/snapshots/#{@host.id}/",
46
12
  :title => _("Manage machine snapshots"))
47
13
  end,
48
14
  if host.build
49
15
  link_to_if_authorized(_("Cancel build"), hash_for_cancelBuild_host_path(:id => host).merge(:auth_object => host, :permission => 'build_hosts'),
50
16
  :disabled => host.can_be_built?,
51
- :title => _("Cancel build request for this host"))
17
+ :title => _("Cancel build request for this host"), :id => "cancel-build-button")
52
18
  else
53
- link_to_if_authorized(_("Build"), hash_for_setBuild_host_path(:id => host).merge(:auth_object => host, :permission => 'build_hosts'),
19
+ link_to_if_authorized(_("Build"), hash_for_host_path(:id => host).merge(:auth_object => host, :permission => 'build_hosts', :anchor => "review_before_build"),
54
20
  :disabled => !host.can_be_built?,
55
21
  :title => _("Enable rebuild on next host boot"),
56
- :confirm => _("Rebuild %s on next reboot?\nThis would also delete all of its current facts and reports") % host)
22
+ :class => "btn",
23
+ :id => "build-review",
24
+ :data => { :toggle => 'modal',
25
+ :target => '#review_before_build',
26
+ :url => review_before_build_host_path(:id => host)
27
+ }
28
+ )
57
29
  end
58
30
  ),
59
31
  if host.compute_resource_id || host.bmc_available?
@@ -70,7 +42,7 @@ module ForemanXen
70
42
  ),
71
43
  button_group(
72
44
  link_to_if_authorized(_("Delete"), hash_for_host_path(:id => host).merge(:auth_object => host, :permission => 'destroy_hosts'),
73
- :class => "btn btn-danger", :confirm => _('Are you sure?'), :method => :delete)
45
+ :class => "btn btn-danger", :id => "delete-button", :data => { :message => _("Are you sure?") }, :method => :delete)
74
46
  )
75
47
  )
76
48
  end
@@ -90,18 +90,7 @@ module ForemanXen
90
90
  end
91
91
 
92
92
  def associated_host(vm)
93
- ips = []
94
- begin
95
- if vm.tools_installed?
96
- vm.guest_metrics.networks.each do |k,v|
97
- ips << v
98
- end
99
- end
100
- rescue => e
101
- logger.error("Error retrieving Network via Guest Metrics: #{e.message}")
102
- end
103
-
104
- Host.authorized(:view_hosts, Host).where(:ip => ips).first
93
+ associate_by("mac", vm.interfaces.map(&:mac))
105
94
  end
106
95
 
107
96
  def get_snapshots_for_vm(vm)
@@ -17,7 +17,7 @@ module ForemanXen
17
17
 
18
18
  initializer 'foreman_xen.register_plugin', :after => :finisher_hook do |app|
19
19
  Foreman::Plugin.register :foreman_xen do
20
- requires_foreman '>= 1.5'
20
+ requires_foreman '>= 1.8'
21
21
  # Register xen compute resource in foreman
22
22
  compute_resource ForemanXen::Xenserver
23
23
  end
@@ -1,3 +1,3 @@
1
1
  module ForemanXen
2
- VERSION = "0.0.6"
2
+ VERSION = "0.1.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_xen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - Pavel Nemirovsky, Michał Piotrowski, Avi Israeli
7
+ - Pavel Nemirovsky, Michal Piotrowski, Avi Israeli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-12 00:00:00.000000000 Z
11
+ date: 2015-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: '1.29'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: '1.29'
55
55
  description: Provision and manage XEN Server from Foreman.
56
56
  email:
57
57
  - operations@oovoo.com
@@ -75,8 +75,8 @@ files:
75
75
  - app/views/compute_resources_vms/form/_network.html.erb
76
76
  - app/views/compute_resources_vms/form/_templates.html.erb
77
77
  - app/views/compute_resources_vms/form/_volume.html.erb
78
- - app/views/compute_resources_vms/form/_xenserver.html.erb
79
78
  - app/views/compute_resources_vms/form/_xenstore.html.erb
79
+ - app/views/compute_resources_vms/form/xenserver/_base.html.erb
80
80
  - app/views/compute_resources_vms/index/_xenserver.html.erb
81
81
  - app/views/compute_resources_vms/show/_xenserver.html.erb
82
82
  - app/views/foreman_xen/snapshots/new.html.erb