Skip to content

Commit

Permalink
Add same thing to vm config
Browse files Browse the repository at this point in the history
  • Loading branch information
swalberg committed Mar 16, 2018
1 parent c770e3f commit d9bc4dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/chef/knife/vsphere_vm_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

require 'chef/knife'
require 'chef/knife/base_vsphere_command'
require 'rbvmomi'
require 'netaddr'
require 'chef/knife/search_helper'

# VsphereVMconfig extends the BaseVspherecommand
class Chef::Knife::VsphereVmConfig < Chef::Knife::BaseVsphereCommand
include SearchHelper
banner "knife vsphere vm config VMNAME PROPERTY VALUE.
See \"http://pubs.vmware.com/vi3/sdk/ReferenceGuide/vim.vm.ConfigSpec.html\"
for allowed ATTRIBUTE values (any property of type xs:string is supported)."
Expand Down Expand Up @@ -39,10 +39,7 @@ def run

vim_connection

dc = datacenter
folder = find_folder(get_config(:folder)) || dc.vmFolder

vm = traverse_folders_for_vm(folder, vmname) || abort("VM #{vmname} not found")
vm = get_vm_by_name(vmname) || fatal_exit("Could not find #{vmname}")

properties = {}
properties[property_name] = property_value
Expand Down
1 change: 1 addition & 0 deletions lib/chef/knife/vsphere_vm_property_set.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# VsphereVMPropertySet extends Basevspherecommand
class Chef::Knife::VsphereVmPropertySet < Chef::Knife::BaseVsphereCommand
include SearchHelper
banner 'knife vsphere vm property set VMNAME PROPERTY VALUE. Sets a vApp Property on VMNAME.'

common_options
Expand Down

0 comments on commit d9bc4dc

Please sign in to comment.