Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 633351 Details for
Bug 870078
Deltacloud RHEVM client needs to Base64-decode user_data when vmpayload is used
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
A patch for deltacloud-core 0.5.0
0001-RHEV-M-Added-support-for-RHEV-M-3.1-vmpayload-user-d.patch (text/plain), 3.44 KB, created by
Michal Fojtik
on 2012-10-25 14:26:24 UTC
(
hide
)
Description:
A patch for deltacloud-core 0.5.0
Filename:
MIME Type:
Creator:
Michal Fojtik
Created:
2012-10-25 14:26:24 UTC
Size:
3.44 KB
patch
obsolete
>From 61c460a9df015e86f77dea49c29599e8e2c2881f Mon Sep 17 00:00:00 2001 >From: Michal Fojtik <mfojtik@redhat.com> >Date: Mon, 22 Oct 2012 11:47:34 +0200 >Subject: [PATCH core] RHEV-M: Added support for RHEV-M 3.1 vmpayload > user-data injection > > >Signed-off-by: Michal fojtik <mfojtik@redhat.com> >--- > .../lib/deltacloud/drivers/rhevm/rhevm_client.rb | 36 ++++++++++++++++------ > 1 file changed, 26 insertions(+), 10 deletions(-) > >diff --git a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb >index 5a75143..dc2fc06 100644 >--- a/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb >+++ b/server/lib/deltacloud/drivers/rhevm/rhevm_client.rb >@@ -19,6 +19,7 @@ require 'restclient' > require 'nokogiri' > require 'digest/md5' > require 'json' >+require 'base64' > > module RHEVM > >@@ -109,14 +110,19 @@ module RHEVM > end > end > >- def cluster_version?(cluster_id, major) >+ def cluster_version(cluster_id) > headers = { > :content_type => 'application/xml', > :accept => 'application/xml' > } > headers.merge!(auth_header) > result_xml = Nokogiri::XML(RHEVM::client(@api_entrypoint)["/clusters/%s" % cluster_id].get(headers)) >- (result_xml/'/cluster/version').first[:major].strip == major >+ version = (result_xml/'/cluster/version').first >+ [version[:major].strip.to_i, version[:minor].strip.to_i] >+ end >+ >+ def cluster_version?(cluster_id, major) >+ cluster_version(cluster_id).first == major.to_i > end > > def capability?(name) >@@ -133,6 +139,7 @@ module RHEVM > opts ||= {} > templ = template(template_id) > raise RHEVMBackendException::new("Requested VM not found in datacenter #{self.current_datacenter.id}") unless templ >+ major_version, minor_version = cluster_version(opts[:realm_id].nil? ? templ.cluster.id : opts[:realm_id]) > builder = Nokogiri::XML::Builder.new do > vm { > name opts[:name] || "i-#{Time.now.to_i}" >@@ -144,14 +151,23 @@ module RHEVM > topology( :cores => (opts[:hwp_cpu] || '1'), :sockets => '1' ) > } > if opts[:user_data] and not opts[:user_data].empty? >- if api_version?('3') and cluster_version?((opts[:realm_id] || clusters.first.id), '3') >- raise "Required VDSM hook 'floppyinject' not supported by RHEV-M" unless capability?(:floppyinject) >- custom_properties { >- custom_property({ >- :name => "floppyinject", >- :value => "#{RHEVM::FILEINJECT_PATH}:#{opts[:user_data]}", >- :regexp => "^([^:]+):(.*)$"}) >- } >+ if api_version?('3') and major_version >= 3 >+ if minor_version >= 1 >+ payloads { >+ payload(:type => 'floppy') { >+ file(:name => RHEVM::FILEINJECT_PATH) { content(Base64::decode64(opts[:user_data])) } >+ } >+ } >+ elsif capability?(:floppyinject) >+ custom_properties { >+ custom_property({ >+ :name => "floppyinject", >+ :value => "#{RHEVM::FILEINJECT_PATH}:#{opts[:user_data]}", >+ :regexp => "^([^:]+):(.*)$"}) >+ } >+ else >+ raise "Required VDSM hook 'floppyinject' not supported by RHEV-M" >+ end > else > raise BackendVersionUnsupportedException.new > end >-- >1.7.12.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 870078
: 633351