File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -93,25 +93,23 @@ def gid(self):
93
93
def mode (self ):
94
94
"""Return file mode as octal integer
95
95
96
- >>> host.file("/etc/passwd ").mode
97
- 384 # 0o600 ( octal)
98
- >>> host.file("/etc/password ").mode == 0o600
96
+ >>> host.file("/etc/shadow ").mode
97
+ 416 # Oo640 octal
98
+ >>> host.file("/etc/shadow ").mode == 0o640
99
99
True
100
- >>> oct(host.file("/etc/password ").mode) == '0600 '
100
+ >>> oct(host.file("/etc/shadow ").mode) == '0o640 '
101
101
True
102
102
103
- Note: Python 3 oct(x)_ function will produce ``'0o600'``
104
-
105
103
You can also utilize the file mode constants from
106
104
the stat_ library for testing file mode.
107
105
108
106
>>> import stat
109
- >>> host.file("/etc/password ").mode == stat.S_IRUSR | stat.S_IWUSR
107
+ >>> host.file("/etc/shadow ").mode == stat.S_IRUSR | stat.S_IWUSR | stat.S_IRGRP
110
108
True
111
109
112
- .. _oct(x): https://docs.python.org/3.5 /library/functions.html#oct
113
- .. _stat: https://docs.python.org/2 /library/stat.html
114
- """
110
+ .. _oct(x): https://docs.python.org/3/library/functions.html#oct
111
+ .. _stat: https://docs.python.org/3 /library/stat.html
112
+ """ # noqa
115
113
raise NotImplementedError
116
114
117
115
def contains (self , pattern ):
You can’t perform that action at this time.
0 commit comments