cem_acpt 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1eb607b0dd6b47c759056a0aa3c1c50d1d304b8aeb604bb7fe2ce5e8738a39b8
4
- data.tar.gz: e2733d6abe61cfae7124d4ad8527d2ef2c1862e8ed9aae14933115f3e09ace6f
3
+ metadata.gz: 7b36c525ca6904813988ad305cc4a89607dff2edcdc8d749e347660047174b37
4
+ data.tar.gz: ed7e418fbcfadd8773f25f026afa0341119ab28c5e3cc91976f46c42e83af5aa
5
5
  SHA512:
6
- metadata.gz: cd2429510a3d927e809b5459c6af5893a1786f19398c861a540de45490ef772944dbd05889a244c5b7be1e2ead068df5547baa9da9f74fed99a3fa47daac8c2d
7
- data.tar.gz: 79eb5728f077fadc64eff99ffd8b665c06abf2aa420c3b164991928dfa561af7dc349b570be6ab174e14f0fae87422b10054c79973c0547c5c25338f0861d94c
6
+ metadata.gz: ee9ccfe1841b755c0f8df1937d66d0e04e62efe29326f16df33af5d9d66fe47441177098a2ffaffd1f843397d19d2f5cf95dcb1b4e536568d0d52cc5848aa052
7
+ data.tar.gz: c1c4f2b3a96134009552f9d464b407b64abef6d37f19df28f99b18b17445a492872a77116e924164c38aa65d1b8a96cb089ae7eff58f7414fbc5d7376f24e5cc
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cem_acpt (0.2.4)
4
+ cem_acpt (0.2.5)
5
5
  concurrent-ruby (~> 1.1.9)
6
6
  deep_merge (~> 1.2.2)
7
7
  net-ssh (~> 7.0.0.beta1)
@@ -337,17 +337,9 @@ module CemAcpt::Platform::Gcp
337
337
 
338
338
  # This function returns the currently authenticated user's name sanitized for use in SSH
339
339
  def authenticated_user_name
340
- uname = nil
341
- begin
342
- uname = local_exec('config get-value account', out_format: nil, project_flag: false)
343
- rescue RuntimeError
344
- auth_json = local_exec('auth list')
345
- uname = auth_json.find { |x| x['status'] == 'ACTIVE' }['account']
346
- end
347
-
348
- raise 'failed to find authenticated user name' unless uname
349
-
350
- uname.gsub(/[^a-zA-Z0-9_]/, '_')
340
+ local_exec('compute os-login describe-profile', project_flag: false)['posixAccounts'][0]['username']
341
+ rescue StandardError => e
342
+ raise "failed to find authenticated user name from os-login profile: #{e.message}"
351
343
  end
352
344
  end
353
345
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CemAcpt
4
- VERSION = '0.2.4'
4
+ VERSION = '0.2.5'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cem_acpt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - puppetlabs