Class: ForemanVirtWhoConfigure::ServiceUser

Inherits:
ApplicationRecord
  • Object
show all
Includes:
Authorizable, Encryptable
Defined in:
app/models/foreman_virt_who_configure/service_user.rb

Overview

holds the encrypted password for internal user that can be deployed to virt who reporter

Instance Method Summary collapse

Instance Method Details

#nameObject

Foreman 1.11 specifics, can be removed later, otherwise when string does not start with “encrypts” prefix we get 500 when we try to create log message that relies on name method



13
14
15
# File 'app/models/foreman_virt_who_configure/service_user.rb', line 13

def name
  username || to_s
end

#usernameObject



17
18
19
20
21
# File 'app/models/foreman_virt_who_configure/service_user.rb', line 17

def username
  User.as_anonymous_admin do
    user&.
  end
end