Fabric "TypeError: not all arguments converted during string formatting"

Posted by Brian Carpio on Stack Overflow See other posts from Stack Overflow or by Brian Carpio
Published on 2012-06-11T16:29:31Z Indexed on 2012/06/11 16:40 UTC
Read the original article Hit count: 297

Filed under:
|

I have the following fabric task:

            @task
            def deploy_west_ec2_ami(name, puppetClass, size='m1.small', region='us-west-1', basedn='joe', ldap='arch-ldap-01', secret='secret', subnet='subnet-d43b8ab
            d', sgroup='sg-926578fe'):
                execute(deploy_ec2_ami, name='%s',puppetClass='%s',size='%s',region='%s',basedn='%s',ldap='%s',secret='%s',subnet='%s',sgroup='%s' %(name, puppetClass
            , size, region, basedn, ldap, secret, subnet, sgroup))

However when I run the command:

fab deploy_west_ec2_ami:test,java

I get the following Traceback:

            Traceback (most recent call last):
              File "/usr/local/lib/python2.6/dist-packages/fabric/main.py", line 710, in main
                *args, **kwargs
              File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 321, in execute
                results['<local-only>'] = task.run(*args, **new_kwargs)
              File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 113, in run
                return self.wrapped(*args, **kwargs)
              File "/home/bcarpio/Projects/githubenterprise/awsdeploy/fabfile.py", line 35, in deploy_west_ec2_ami
                execute(deploy_ec2_ami, name='%s',puppetClass='%s',size='%s',region='%s',basedn='%s',ldap='%s',secret='%s',subnet='%s',sgroup='%s' %(name, puppetClass, size, region, basedn, ldap, secret, subnet, sgroup))
            TypeError: not all arguments converted during string formatting

I am not sure I understand why. I am pretty sure I have all the values defined here just fine.

Also when I run the execute task deploy_ec2_ami as so:

deploy_ec2_ami:test,java,m1.small,us-west-1,'dc\=test\,dc\=net',ldap-01,secret,subnet-d43b8abd,sg-926578fe

It works just fine

© Stack Overflow or respective owner

Related posts about python

Related posts about fabric

  • Windows Azure Learning Plan - Application Fabric

    as seen on SQL Blog - Search for 'SQL Blog'
    This is one in a series of posts on a Windows Azure Learning Plan. You can find the main post here. This one deals with the Application Fabric for Windows Azure. It serves three main purposes - Access Control, Caching, and as a Service Bus.   Overview and Training Overview… >>> More

  • fabric and svn password

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Assuming that I cannot run something like this with Fabric: run("svn update --password 'password' .") how's the proper way to pass to Fabric the password for the remote interactive command line? I am not sure, but the svn server we're using might have some restrictions to not allow --non-interactive… >>> More

  • Python Fabric error

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I'm running fabric (Django deployment to apache) and everything seems to work fine until I get to the task for installing the site: def install_site(): "Add the virtualhost file to apache" require('release', provided_by=[deploy, setup]) sudo('cd %(path)/releases/%(release)/%(release);… >>> More

  • How to set target hosts in Fabric file

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I want to use Fabric to deploy my web app code to development, staging and production servers. My fabfile: def deploy_2_dev(): deploy('dev') def deploy_2_staging(): deploy('staging') def deploy_2_prod(): deploy('prod') def deploy(server): print 'env.hosts:', env.hosts env.hosts = [server] … >>> More

  • fabric deploy problem

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Hi, I'm trying to deploy a django app with fabric and get the following error: Alexs-MacBook:fabric alex$ fab config:instance=peergw deploy -H <ip> - u <username> -p <password> [192.168.2.93] run: cat /etc/issue Traceback (most recent call last): File "build/bdist.macosx-10… >>> More