Module: Bcome::Ssh::DriverUser

Included in:
Driver
Defined in:
lib/objects/ssh/driver_concerns/user.rb

Instance Method Summary collapse

Instance Method Details

#fallback_bastion_host_userObject



28
29
30
# File 'lib/objects/ssh/driver_concerns/user.rb', line 28

def fallback_bastion_host_user
  user
end

#fallback_local_userObject



24
25
26
# File 'lib/objects/ssh/driver_concerns/user.rb', line 24

def fallback_local_user
  @fallback_local_user ||= ::Bcome::System::Local.instance.local_user
end

#get_overriden_local_userObject



20
21
22
# File 'lib/objects/ssh/driver_concerns/user.rb', line 20

def get_overriden_local_user
  ::Bcome::Node::Factory.instance.local_data[:ssh_user]
end

#overriden_local_userObject



16
17
18
# File 'lib/objects/ssh/driver_concerns/user.rb', line 16

def overriden_local_user
  @overriden_local_user ||= get_overriden_local_user
end

#userObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/objects/ssh/driver_concerns/user.rb', line 5

def user
  # If we have a user explictly set in the config, then return it
  return @config[:user] if @config[:user]

  # If the local user has explicitly overriden their user, return that
  return overriden_local_user if overriden_local_user

  # Else fall back to whichever local user is using bcome
  fallback_local_user
end