]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commit
Use string formatting instead of string replace
authorCedric Brandily <zzelle@gmail.com>
Thu, 22 Oct 2015 21:45:32 +0000 (23:45 +0200)
committerCedric Brandily <zzelle@gmail.com>
Thu, 22 Oct 2015 21:45:32 +0000 (23:45 +0200)
commita4170cf1bfd3939f54be178e32a258709cc0f76c
treec45d54791d367d90ad3d69eed7d7f6d64d731a9b
parente5a7b25b2774dda3701dfd893ba4339f5312051d
Use string formatting instead of string replace

Currently linuxbridge_neutron_agent[1] uses the pattern:

 PLACEHOLDER = "..."
 PATH = PREFIX + PLACEHOLDER + SUFFIX
 ...
 my_path = PATH.replace(PLACEHOLDER, my_value)

which could be replaced by the following which is more common and in
general safer:

 PATH = PREFIX + '%s' + SUFFIX
 ...
 my_path = PATH % my_value)

Change-Id: I2d23b11fa6fb7f31c1abbe36523b75bfc81f5c46
neutron/plugins/ml2/drivers/linuxbridge/agent/linuxbridge_neutron_agent.py