File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -55,25 +55,25 @@ from pyinfra.api import operation
55
55
from pyinfra.facts.files import File
56
56
57
57
@operation ()
58
- def file (name , present = True ):
58
+ def file (path , present = True ):
59
59
'''
60
60
Manage the state of files.
61
61
62
- + name : name/path of the remote file
62
+ + path : name/path of the remote file
63
63
+ present: whether the file should exist
64
64
'''
65
65
66
- info = host.get_fact(File, path = name )
66
+ info = host.get_fact(File, path = path )
67
67
68
68
# Not a file?!
69
69
if info is False :
70
- raise OperationError(" {0} exists and is not a file" .format(name ))
70
+ raise OperationError(" {0} exists and is not a file" .format(path ))
71
71
72
72
# Doesn't exist & we want it
73
73
if info is None and present:
74
- yield " touch {0} " .format(name )
74
+ yield " touch {0} " .format(path )
75
75
76
76
# It exists and we don't want it
77
77
elif info and not present:
78
- yield " rm -f {0} " .format(name )
78
+ yield " rm -f {0} " .format(path )
79
79
```
You can’t perform that action at this time.
0 commit comments