Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error messages from vzlist get used as ctids #38

Open
drt24 opened this issue Jan 27, 2016 · 0 comments
Open

Error messages from vzlist get used as ctids #38

drt24 opened this issue Jan 27, 2016 · 0 comments

Comments

@drt24
Copy link
Contributor

drt24 commented Jan 27, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant