File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ def curl_command(cmd, target):
32
32
33
33
root = ET .fromstring (r .stdout )
34
34
if root .tag == '{DAV:}error' :
35
- raise DAVException (root .find ('{http://sabredav.org/ns}message' ).text + ': ' + target )
35
+ raise DAVException (root .find ('{http://sabredav.org/ns}message' ).text , target )
36
36
37
37
return root
38
38
@@ -56,7 +56,13 @@ def mkdir(target):
56
56
Make a directory 'target'
57
57
"""
58
58
print ("MKDIR" ,target )
59
- curl_command (['-X' ,'MKCOL' ], target )
59
+ try :
60
+ curl_command (['-X' ,'MKCOL' ], target )
61
+ except DAVException as e :
62
+ if e .args [0 ] == 'The resource you tried to create already exists' :
63
+ pass
64
+ else :
65
+ raise
60
66
61
67
62
68
def put_recursive (path , target ):
@@ -88,7 +94,7 @@ def main():
88
94
89
95
sub_mkdir = subp .add_parser ('mkdir' , help = "Make directory" )
90
96
sub_mkdir .add_argument ("target" )
91
- sub_mkdir .set_defaults (func = put )
97
+ sub_mkdir .set_defaults (func = mkdir )
92
98
93
99
args = parser .parse_args ()
94
100
You can’t perform that action at this time.
0 commit comments