Browse files

Fix HDFS unpropagation

The unpropagate action with the HDFS adapter was not working because it
was using wrong variable names. Bug report and initial patch provided by
Brett Wu.

Closes #100.
  • Loading branch information...
1 parent 73173b5 commit 32d323d9db03f7cdb397504660157e5f901f01ab @priteau priteau committed Jul 3, 2012
Showing with 8 additions and 8 deletions.
  1. +8 −8 control/src/python/workspacecontrol/defaults/imageprocurement/propagate_hdfs.py
View
16 control/src/python/workspacecontrol/defaults/imageprocurement/propagate_hdfs.py
@@ -102,10 +102,10 @@ def propagate(self, remote_source, local_absolute_target):
self.c.log.info("Transfer complete: %fs" % round(transfer_time))
def unpropagate(self, local_absolute_source, remote_target):
- self.c.log.info("HDFS unpropagation - local target: %s" % local_absolute_target)
- self.c.log.info("HDFS unpropagation - remote source: %s" % remote_source)
+ self.c.log.info("HDFS unpropagation - local source: %s" % local_absolute_source)
+ self.c.log.info("HDFS unpropagation - remote target: %s" % remote_target)
- cmd = self.__generate_hdfs_push_cmd(remote_source, local_absolute_target)
+ cmd = self.__generate_hdfs_push_cmd(local_absolute_source, remote_target)
self.c.log.info("Running HDFS command: %s" % cmd)
transfer_time = -time()
try:
@@ -127,27 +127,27 @@ def unpropagate(self, local_absolute_source, remote_target):
#--------------------------------------------------------------------------
# Private helper functions
- def __generate_hdfs_pull_cmd(self, remote_target, local_absolute_target):
+ def __generate_hdfs_pull_cmd(self, remote_source, local_absolute_target):
# Generate command in the form of:
# /path/to/hadoop/bin/hadoop fs -fs <files system uri> -copyToLocal <src> <localdst>
if not self.parsed_source_url:
- self.parsed_source_url = self.__parse_url(remote_target)
+ self.parsed_source_url = self.__parse_url(remote_source)
ops = [self.hadoop, "fs",
"-fs", self.parsed_source_url[0]+'://'+self.parsed_source_url[1],
"-copyToLocal", self.parsed_source_url[2], local_absolute_target]
cmd = " ".join(ops)
return cmd
- def __generate_hdfs_push_cmd(self, remote_target, local_absolute_target):
+ def __generate_hdfs_push_cmd(self, local_absolute_source, remote_target):
# Generate command in the form of:
# /path/to/hadoop/bin/hadoop fs -fs <files system uri> -copyFromLocal <local> <dst>
if not self.parsed_dest_url:
self.parsed_dest_url = self.__parse_url(remote_target)
ops = [self.hadoop, "fs",
- "-fs", self.parsed_dest_url[0]+'://'+self.parsed_dest_url[1],
- "-copyFromLocal", local_absolute_target ,self.parsed_dest_url[2]]
+ "-fs", self.parsed_dest_url[0] + '://'+self.parsed_dest_url[1],
+ "-copyFromLocal", local_absolute_source, self.parsed_dest_url[2]]
cmd = " ".join(ops)
return cmd

0 comments on commit 32d323d

Please sign in to comment.