次のファブリック タスクがあります。
@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-d43b8abd', 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))
ただし、コマンドを実行すると:
fab deploy_west_ec2_ami:test,java
次のトレースバックが表示されます。
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
その理由がよくわかりません。ここで定義されたすべての値がうまくいっていると確信しています。
また、実行タスク deploy_ec2_ami を実行すると、次のようになります。
deploy_ec2_ami:test,java,m1.small,us-west-1,'dc\=test\,dc\=net',ldap-01,secret,subnet-d43b8abd,sg-926578fe
それはうまく動作します