EzDevInfo.com

fileconveyor

File Conveyor is a daemon written in Python to detect, process and sync files. In particular, it's designed to sync files to CDNs. Amazon S3 and Rackspace Cloud Files, as well as any Origin Pull or (S)FTP Push CDN, are supported. Originally written for my bachelor thesis at Hasselt University in Belgium. File Conveyor — fileconveyor.org — github.com/wimleers/fileconveyor

Fileconveyor Error - UnboundLocalError: local variable 'classname' referenced before assignment

I am using fileconvayor form https://github.com/wimleers/fileconveyor

but when I run the script I get the following error.

Traceback (most recent call last):
File "arbitrator.py", line 1185, in <module>
run_file_conveyor()
File "arbitrator.py", line 1168, in run_file_conveyor
arbitrator = Arbitrator(os.path.join(FILE_CONVEYOR_PATH, "config.xml"), rest
art)
File "arbitrator.py", line 142, in __init__
transporter_class = self._import_transporter(transporter_name)
File "arbitrator.py", line 1162, in _import_transporter
self.logger.error("The Transporter module '%s' was found, but its Transporte
r class '%s' could not be found."  % (module_name, classname))
UnboundLocalError: local variable 'classname' referenced before assignment
[root@af-server fileconveyor]#

Here is the code from arbitrator.py line 142

   # Verify that all referenced transporters are available.
    transporters_not_found = 0
    for server in self.config.servers.keys():
        transporter_name = self.config.servers[server]["transporter"]
        transporter_class = self._import_transporter(transporter_name)
        if not transporter_class:
            transporters_not_found += 1
    if transporters_not_found > 0:
        raise TransporterAvailabilityTestError("Consult the log file for details")

and the code from line 1162

transporter_class = None
    module = None
    alternatives = [transporter]
    default_prefix = 'transporters.transporter_' # Not  'fileconveyor.transporters.transporter_'!
    if not transporter.startswith(default_prefix):
        alternatives.append('%s%s' % (default_prefix, transporter))
    for module_name in alternatives:
        try:
            module = __import__(module_name, globals(), locals(), ["TRANSPORTER_CLASS"], -1)
        except ImportError:
            pass
    if not module:
        msg = "The transporter module '%s' could not be found." % transporter
        if len(alternatives) > 1:
            msg = '%s Tried (%s)' % (msg, ', '.join(alternatives))
        self.logger.error(msg)
    else:
        try:
            classname = module.TRANSPORTER_CLASS
            module = __import__(module_name, globals(), locals(), [classname])
            transporter_class = getattr(module, classname)
        except AttributeError:
            self.logger.error("The Transporter module '%s' was found, but its Transporter class '%s' could not be found."  % (module_name, classname))
    return transporter_class

Here is whole code form that file

http://pastebin.com/ctsLrckq


Source: (StackOverflow)

FileConveyor can't find sftp transporter

# python /root/src/fileconveyor/fileconveyor/arbitrator.py 
/root/src/fileconveyor/fileconveyor/filter.py:10: DeprecationWarning: the sets module is deprecated
  from sets import Set, ImmutableSet
2014-01-23 00:23:34,615 - Arbitrator                - WARNING  - File Conveyor is initializing.
2014-01-23 00:23:34,621 - Arbitrator                - WARNING  - Loaded config file.
2014-01-23 00:23:34,624 - Arbitrator                - ERROR    - The transporter module 'sftp' could not be found. Tried (sftp, transporters.transporter_sftp)
TransporterAvailabilityTestError Consult the log file for details

I just installed fileconveyor and created a simple config.xml, but the system chokes on start up because it can't find the sftp transporter. I've verified the sftp transporter is there and has what I assume to be good permissions and ownership (I'm root, the files are owned by root and 644).

What am I doing wrong?


Source: (StackOverflow)

Advertisements