Skip to content

Commit 73b34ba

Browse files
author
Dennis Schmidt & Ian Baker
committed
fix setup_yeti script, workaround for bug [#47465247]
1 parent 1c40308 commit 73b34ba

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bin/setup_yeti

+12-3
Original file line numberDiff line numberDiff line change
@@ -77,16 +77,25 @@ module YetiSetup
7777
"\"name\":\"#{name}\", " +
7878
"\"user_guids\": [\"#{user_guid}\"], " +
7979
"\"manager_guids\": [\"#{user_guid}\"], " +
80-
"\"billing_enabled\": true, " +
8180
"\"quota_definition_guid\": \"#{quota_guid}\" " +
8281
"}'" +
8382
" #{cc_url}/v2/organizations"
8483
output = run cmd
8584
guid = output[/"guid": "([^"]*)/, 1]
86-
error "could not extract space guid" unless guid
85+
error "could not extract org guid" unless guid
86+
87+
enable_billing(cc_url, token, guid)
8788
guid
8889
end
8990

91+
def self.enable_billing(cc_url, token, guid)
92+
puts "# setting billing_enabled: true"
93+
cmd = "curl -v -X PUT -H 'Content-Type: application/json' " +
94+
" -H 'Authorization: #{token}' " +
95+
" -d '{\"billing_enabled\":true}'" +
96+
" #{cc_url}/v2/organizations/#{guid}"
97+
run cmd
98+
end
9099

91100
def self.create_cc_space(cc_url, token, name, org_guid, user_guid)
92101
puts "# creating cc space"
@@ -101,7 +110,7 @@ module YetiSetup
101110
" #{cc_url}/v2/spaces"
102111
output = run cmd
103112
guid = output[/"guid": "([^"]*)/, 1]
104-
error "could not extract org guid" unless guid
113+
error "could not extract space guid" unless guid
105114
guid
106115
end
107116

0 commit comments

Comments
 (0)