File tree Expand file tree Collapse file tree
src/command_modules/azure-cli-acr
azure/cli/command_modules/acr Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ Release History
55
662.0.23
77++++++
8-
8+ * Improve error handling of wincred fallback.
99* `sdist ` is now compatible with wheel 0.31.0
1010
11112.0.22
Original file line number Diff line number Diff line change @@ -250,7 +250,8 @@ def _check_wincred(login_server):
250250 if platform .system () == 'Windows' :
251251 import json
252252 from os .path import expanduser , isfile , join
253- config_path = join (expanduser ('~' ), '.docker' , 'config.json' )
253+ docker_directory = join (expanduser ('~' ), '.docker' )
254+ config_path = join (docker_directory , 'config.json' )
254255 logger .debug ("Docker config file path %s" , config_path )
255256 if isfile (config_path ):
256257 with open (config_path ) as input_file :
@@ -268,18 +269,23 @@ def _check_wincred(login_server):
268269 with open (config_path , 'w' ) as output_file :
269270 json .dump (content , output_file , indent = 4 )
270271 output_file .close ()
271- return True
272+ return True
272273 return False
273274 except NoTTYException :
274275 return False
275276 # Don't update config file or retry as this doesn't seem to be a wincred issue
276277 return False
277278 else :
279+ import os
278280 content = {
279281 "auths" : {
280282 login_server : {}
281283 }
282284 }
285+ try :
286+ os .makedirs (docker_directory )
287+ except OSError :
288+ pass
283289 with open (config_path , 'w' ) as output_file :
284290 json .dump (content , output_file , indent = 4 )
285291 output_file .close ()
You can’t perform that action at this time.
0 commit comments