Skip to content

Error messages from vzlist get used as ctids #38

@drt24

Description

@drt24

I got this error message:
Error: /Virt[test-1]: Could not evaluate: Execution of '/usr/sbin/vzctl status Unable' returned 21: Bad CT ID Unable

Looking in puppet-virt/lib/puppet/provider/virt/openvz.rb I see:

  # Returns all host's guests
  def self.instances
    guests = []
    execpipe "#{vzlist} --no-header -a -o ctid" do |process|
    process.collect do |line|
      next unless options = parse(line)
        guests << new(options)
      end
    end
    guests
  end

Unfortunately if I run:

    $ sudo vzlist --no-header -a -o ctid

I get

    Unable to open /proc/vz/veinfo: No such file or directory
    Unable to open /proc/user_beancounters: No such file or directory

(as OpenVZ is not properly set up) Unfortunately vzlist does not return an error code in this case. Perhaps some validation of its output would solve this problem and prevent garbage spreading through the code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions