Fix typo (fcntl, not fnctl)

This commit is contained in:
Colton Myers 2013-10-28 16:15:45 -06:00
parent 7be4df6a3a
commit dc393131b8
2 changed files with 7 additions and 7 deletions

View File

@ -11,10 +11,10 @@ import os
try: try:
import fcntl import fcntl
HAS_FNCTL = True HAS_FCNTL = True
except ImportError: except ImportError:
# fcntl is not available on windows # fcntl is not available on windows
HAS_FNCTL = False HAS_FCNTL = False
# Import salt libs # Import salt libs
import salt.fileserver import salt.fileserver
@ -173,7 +173,7 @@ def file_hash(load, fnd):
if not os.path.exists(cache_dir): if not os.path.exists(cache_dir):
os.makedirs(cache_dir) os.makedirs(cache_dir)
# save the cache object "hash:mtime" # save the cache object "hash:mtime"
if HAS_FNCTL: if HAS_FCNTL:
with salt.utils.flopen(cache_path, 'w') as fp_: with salt.utils.flopen(cache_path, 'w') as fp_:
fp_.write('{0}:{1}'.format(ret['hsum'], os.path.getmtime(path))) fp_.write('{0}:{1}'.format(ret['hsum'], os.path.getmtime(path)))
fcntl.flock(fp_.fileno(), fcntl.LOCK_UN) fcntl.flock(fp_.fileno(), fcntl.LOCK_UN)

View File

@ -48,10 +48,10 @@ except ImportError:
try: try:
import fcntl import fcntl
HAS_FNCTL = True HAS_FCNTL = True
except ImportError: except ImportError:
# fcntl is not available on windows # fcntl is not available on windows
HAS_FNCTL = False HAS_FCNTL = False
try: try:
import win32api import win32api
@ -964,7 +964,7 @@ def fopen(*args, **kwargs):
survive into the new program after exec. survive into the new program after exec.
''' '''
fhandle = open(*args, **kwargs) fhandle = open(*args, **kwargs)
if HAS_FNCTL: if HAS_FCNTL:
# modify the file descriptor on systems with fcntl # modify the file descriptor on systems with fcntl
# unix and unix-like systems only # unix and unix-like systems only
try: try:
@ -980,7 +980,7 @@ def fopen(*args, **kwargs):
def flopen(*args, **kwargs): def flopen(*args, **kwargs):
fhandle = open(*args, **kwargs) fhandle = open(*args, **kwargs)
if HAS_FNCTL: if HAS_FCNTL:
# modify the file descriptor on systems with fcntl # modify the file descriptor on systems with fcntl
# unix and unix-like systems only # unix and unix-like systems only
try: try: