Replies: 3 comments 1 reply
-
|
Beta Was this translation helpful? Give feedback.
-
Hi @pankajc80, get_ldap_attribute depends on an old tool called There is more information about MiqLdap and SSSD in this conversion blog post: https://www.manageiq.org/blog/2017/09/miqldap-to-sssd/ If you still need to connect to LDAP from your automation code, you can copy the old MiqLdap code into your automate module or use the Net::LDAP ruby library in your automate code directly. |
Beta Was this translation helpful? Give feedback.
-
get_ldap_attribute(cn)
NameError: undefined local variable or method `cn' for main:Object In a ruby sense, the error says that you referenced a variable But also see jason's comment about that library no longer being supported. |
Beta Was this translation helpful? Give feedback.
-
HI All,
I have created a Service Dialog with Dynamic Text Box to auto fill with LDAP username, email and Department when a user access self- service portal to request for VM provisioning (Authentication is via Active Directory).
Snippet of the code to pull data from LDAP:
$evm.log(:info, "get_username started")
user = $evm.object['user'].get_ldap_attribute.cn
As per the documentation, get_ladap_attribute(name) is the preferred way, tried with multiple options as below and different error each time:
get_ldap_attribute(cn)
NameError: undefined local variable or method `cn' for main:Object
user = $evm.root['user'].get_ldap_attribute.cn
ArgumentError: wrong number of arguments (given 0, expected 1)
user = $evm.root['user'].get_ldap_attribute:cn --->> This option is working when used with Cloudforms
Net::LDAP::Error:
Can someone please suggest what am I missing or doing incorrectly?
Thanks in anticipation.
Beta Was this translation helpful? Give feedback.
All reactions