Skip to content
This repository has been archived by the owner on Aug 21, 2020. It is now read-only.

Better error reporting for failed license assigment #216

Open
ggeldenhuis opened this issue Oct 20, 2016 · 0 comments
Open

Better error reporting for failed license assigment #216

ggeldenhuis opened this issue Oct 20, 2016 · 0 comments

Comments

@ggeldenhuis
Copy link
Contributor

transport { 'vmware':
  username => 'administrator',
  password => 'password',
  server   => 'vcenter01.example.com',
  options  => { 'insecure' => true },
}

vc_datacenter { 'dc1':
  path      => '/dc1',
  ensure    => present,
  transport => Transport['vmware'],
}


esx_license { 'vcenter_license':
  ensure      => present,
  license_key => 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX',
  transport   => Transport['vmware'],
  require     => Transport['vmware'],
}

esx_license_assignment { 'vcenter.example.com':
  license_key => 'XXXXX-XXXXX-XXXXX-XXXXX-XXXXX',
  transport   => Transport['vmware'],
  require     => [ Transport['vmware'],
                   Esx_license['vcenter_license']],
}

The difference is rather small. If you try to assign a license to vcenter.example.com but the server is actually called vcenter01.example.com then you will get the following error:

Could not evaluate: undefined method `assignedLicense' for nil:NilClass

It would be good to encapsulate the license assignment in a try--except statement with a more detailed error telling you what you are trying to do.

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

No branches or pull requests

1 participant