Class: AwsMfaClient
- Inherits:
-
Object
- Object
- AwsMfaClient
- Defined in:
- lib/aws_mfa_client.rb
Instance Method Summary collapse
- #execute(execution_output = :set_env, profile = nil) ⇒ Object
- #running_on_aws_ec2_instance? ⇒ Boolean
Instance Method Details
#execute(execution_output = :set_env, profile = nil) ⇒ Object
4 5 6 7 |
# File 'lib/aws_mfa_client.rb', line 4 def execute(execution_output = :set_env, profile = nil) return if running_on_aws_ec2_instance? AwsMfa.new.execute(execution_output, profile) end |
#running_on_aws_ec2_instance? ⇒ Boolean
9 10 11 12 |
# File 'lib/aws_mfa_client.rb', line 9 def running_on_aws_ec2_instance? File.file?("/sys/hypervisor/uuid") && File.read("/sys/hypervisor/uuid")[0..2] == "ec2" end |