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

View File

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