lib/conjur/base.rb in conjur-api-2.1.6 vs lib/conjur/base.rb in conjur-api-2.1.7

- old
+ new

@@ -23,10 +23,12 @@ if id.is_a?(Hash) tokens = id['id'].split(':') [ id['account'], 'roles', tokens[0], tokens[1..-1].join(':') ] elsif id.is_a?(String) paths = path_escape(id).split(':') - raise "Expecting account:kind:id in role #{id}" unless paths.size >= 3 + if paths.size == 2 + paths.unshift Conjur.account + end [ paths[0], 'roles', paths[1], paths[2..-1].join(':') ] else raise "Unexpected class #{id.class} for #{id}" end end