summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rwxr-xr-xxlators/experimental/fdl/src/gen_recon.py2
-rw-r--r--xlators/features/glupy/examples/negative.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/xlators/experimental/fdl/src/gen_recon.py b/xlators/experimental/fdl/src/gen_recon.py
index 75323ea3dd9..69e45698703 100755
--- a/xlators/experimental/fdl/src/gen_recon.py
+++ b/xlators/experimental/fdl/src/gen_recon.py
@@ -101,7 +101,7 @@ def get_special_subs (name, args, fop_type):
code += fragments[recon_type].replace("@ARGNAME@",arg[1]) \
.replace("@ARGTYPE@",arg[2])
cleanup_key = recon_type + "_CLEANUP"
- if fragments.has_key(cleanup_key):
+ if cleanup_key in fragments:
new_frag = fragments[cleanup_key].replace("@ARGNAME@",arg[1])
# Make sure these get added in *reverse* order. Otherwise, a
# failure for an earlier argument might goto a label that falls
diff --git a/xlators/features/glupy/examples/negative.py b/xlators/features/glupy/examples/negative.py
index 543f3109502..836008682ba 100644
--- a/xlators/features/glupy/examples/negative.py
+++ b/xlators/features/glupy/examples/negative.py
@@ -35,7 +35,7 @@ class xlator (Translator):
pargfid = uuid2str(loc.contents.pargfid)
print("lookup FOP: %s:%s" % (pargfid, loc.contents.name))
# Check the cache.
- if cache.has_key(pargfid):
+ if pargfid in cache:
if loc.contents.name in cache[pargfid]:
print("short-circuiting for %s:%s" % (pargfid,
loc.contents.name))
@@ -55,11 +55,11 @@ class xlator (Translator):
# Update the cache.
if op_ret == 0:
print("found %s, removing from cache" % name)
- if cache.has_key(pargfid):
+ if pargfid in cache:
cache[pargfid].discard(name)
elif op_errno == 2: # ENOENT
print("failed to find %s, adding to cache" % name)
- if cache.has_key(pargfid):
+ if pargfid in cache:
cache[pargfid].add(name)
else:
cache[pargfid] = {name}
@@ -85,7 +85,7 @@ class xlator (Translator):
# Update the cache.
if op_ret == 0:
print("created %s, removing from cache" % name)
- if cache.has_key(pargfid):
+ if pargfid in cache:
cache[pargfid].discard(name)
del self.requests[key]
dl.unwind_create(frame,cookie,this,op_ret,op_errno,fd,inode,buf,