File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
lib/fog/compute/google/models Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def get_public_key(public_key_path)
109
109
end
110
110
111
111
if public_key_path . nil? || public_key_path . empty?
112
- raise ArgumentError ( "cannot bootstrap instance without public key file ")
112
+ raise Fog :: Errors :: Error . new ( "Cannot bootstrap instance without a public key")
113
113
end
114
114
115
115
File . read ( File . expand_path ( public_key_path ) )
Original file line number Diff line number Diff line change @@ -41,6 +41,14 @@ def test_bootstrap
41
41
"Bootstrapped server should have an external ip by default" )
42
42
end
43
43
end
44
+
45
+ def test_bootstrap_fail
46
+ # Pretend the ssh key does not exist
47
+ File . stub :exist? , nil do
48
+ assert_raises ( Fog ::Errors ::Error ) {
49
+ @subject . bootstrap ( :name => "#{ CollectionFactory ::PREFIX } -#{ Time . now . to_i } " ,
50
+ :public_key_path => nil )
51
+ }
44
52
end
45
53
end
46
54
end
You can’t perform that action at this time.
0 commit comments