← Back to team overview

duplicity-team team mailing list archive

Re: [Question #255740]: Dropbox backend: global name 'rest' is not defined when changing app id and secret

 

Question #255740 on Duplicity changed:
https://answers.launchpad.net/duplicity/+question/255740

    Status: Open => Answered

edso proposed the following answer:
On 15.10.2014 04:26, Cyrus David wrote:
> Question #255740 on Duplicity changed:
> https://answers.launchpad.net/duplicity/+question/255740
> 
> Description changed to:
> Steps I did:
> 
> 1. `curl -L http://code.launchpad.net/duplicity/0.6-series/0.6.24/+download/duplicity-0.6.24.tar.gz | tar xz`
> 2. `cd duplicity-0.6.24`
> 3. `vim duplicity/backends/dpbxbackend.py` and change the `APP_KEY` and `APP_SECRET` values.
> 4. `sudo checkinstall python setup.py install`
> 
> The error:
> 
> ```
> Traceback (most recent call last):
>   File "/usr/local/bin/duplicity", line 1502, in <module>
>     with_tempdir(main)
>   File "/usr/local/bin/duplicity", line 1496, in with_tempdir
>     fn()
>   File "/usr/local/bin/duplicity", line 1329, in main
>     action = commandline.ProcessCommandLine(sys.argv[1:])
>   File "/usr/local/lib/python2.7/dist-packages/duplicity/commandline.py", line 1059, in ProcessCommandLine
>     backup, local_pathname = set_backend(args[0], args[1])
>   File "/usr/local/lib/python2.7/dist-packages/duplicity/commandline.py", line 952, in set_backend
>     globals.backend = backend.get_backend(bend)
>   File "/usr/local/lib/python2.7/dist-packages/duplicity/backend.py", line 163, in get_backend
>     return _backends[pu.scheme](pu)
>   File "/usr/local/lib/python2.7/dist-packages/duplicity/backends/dpbxbackend.py", line 156, in __init__
>     self.login()
>   File "/usr/local/lib/python2.7/dist-packages/duplicity/backends/dpbxbackend.py", line 162, in login
>     except rest.ErrorResponse, e:
> NameError: global name 'rest' is not defined
> ```
> 

can you try to add the following line

 global client, rest, session

as line 103 into

 /usr/local/lib/python2.7/dist-
packages/duplicity/backends/dpbxbackend.py"

?

it should then look like

...
    def __init__(self, parsed_url):
        duplicity.backend.Backend.__init__(self, parsed_url)

        global client, rest, session
        from dropbox import client, rest, session
...

does that work?.. ede/duply.net

-- 
You received this question notification because you are a member of
duplicity-team, which is an answer contact for Duplicity.