ayohrling / local_security_policy

Apache License 2.0
6 stars 28 forks source link

"Validate method failed" error raised when using empty policy_value #86

Closed Andy-Adrian closed 4 years ago

Andy-Adrian commented 4 years ago

The following error is raised when using an empty or Nil policy_value, rather than the defined text in the ArgumentError

Error: Parameter policy_value failed on Local_security_policy[Network access: Shares that can be accessed anonymously]: Validate method failed for class policy_value: undefined method `ArgumentError' for # (file: [redacted])

Fix by changing https://github.com/ayohrling/local_security_policy/blob/master/lib/puppet/type/local_security_policy.rb#L74 to

raise ArgumentError,"Value cannot be nil or empty"

The same syntax change will need to be applied to https://github.com/ayohrling/local_security_policy/blob/master/lib/puppet/type/local_security_policy.rb#L80 as well