Method: Rbeapi::Netdev::Snmp#snmp_user_password_hash
- Defined in:
- lib/rbeapi/netdev/snmp.rb
#snmp_user_password_hash(running_config, user_cmd) ⇒ Hash<Symbol,String>
snmp_user_password obtains the password hash from the device in order to provide an idempotent configuration value.
356 357 358 359 360 |
# File 'lib/rbeapi/netdev/snmp.rb', line 356 def snmp_user_password_hash(running_config, user_cmd) regexp = /#{user_cmd} .*?auth \w+\s+(.*?)\s+priv \w+\s+(.*?)\s/ (auth_hash, priv_hash) = running_config.scan(regexp).first { auth: auth_hash, privacy: priv_hash } end |