Make the script available on Mac (BSD)

`tools/migrate_from_tempest.sh` doesn't work at BSD, because `sed`
command requires parameter for `-i` option.
This patch fixes it.

Change-Id: I262638dbd3afd0c089bc6a2491104d5207006750
This commit is contained in:
OTSUKA, Yuanying
2015-09-25 13:51:44 +09:00
parent fc6ea99b77
commit d4a2d5615d

View File

@@ -76,16 +76,16 @@ for file in $files; do
if [ $service_client -eq 1 ]; then
# service_client module is not necessary in tempest-lib because rest_client can be used instead
sed -i s/"from tempest.common import service_client"/"from tempest_lib.common import rest_client"/ $dest_file
sed -i s/"service_client.ServiceClient"/"rest_client.RestClient"/ $dest_file
sed -i s/"service_client.ResponseBody"/"rest_client.ResponseBody"/ $dest_file
sed -i s/"from tempest\."/"from tempest_lib\."/ $dest_file
sed -i='' s/"from tempest.common import service_client"/"from tempest_lib.common import rest_client"/ $dest_file
sed -i='' s/"service_client.ServiceClient"/"rest_client.RestClient"/ $dest_file
sed -i='' s/"service_client.ResponseBody"/"rest_client.ResponseBody"/ $dest_file
sed -i='' s/"from tempest\."/"from tempest_lib\."/ $dest_file
# Replace mocked path in unit tests
sed -i s/"tempest.common.rest_client"/"tempest_lib.common.rest_client"/ $dest_file
sed -i='' s/"tempest.common.rest_client"/"tempest_lib.common.rest_client"/ $dest_file
# Remove ".json" from import line
sed -i -e "s/^\(from tempest_lib\.services\..*\)\.json\(.*\)/\1\2/" $dest_file
sed -i='' -e "s/^\(from tempest_lib\.services\..*\)\.json\(.*\)/\1\2/" $dest_file
fi
git add "$dest_file"