fix sed command in macros 31/51831/2
authorwutianwei <wutianwei1@huawei.com>
Wed, 7 Feb 2018 03:48:44 +0000 (11:48 +0800)
committerwutianwei <wutianwei1@huawei.com>
Wed, 7 Feb 2018 04:03:02 +0000 (12:03 +0800)
The char "/" was included in $msg.
It will have issue

"sed: -e expression #1, char 7: unknown option to `s'"

We can substitute '/' with '#' in sed command to solve this issue

Signed-off-by: wutianwei <wutianwei1@huawei.com>
Change-Id: I1308e9b1b2111f0033df119e4465df4dda27eac0

jjb/global/releng-macros.yml

index bd9f97d..a7d947f 100644 (file)
           if [[ -s violation.log ]]; then
               echo "Reporting lint result..."
               msg="Found syntax error and/or coding style violation(s) in the files modified by your patchset."
-              sed -i -e '1s/^//$msg\n\n/' violation.log
+              sed -i -e "1s#^#${msg}\n\n#" violation.log
               cmd="gerrit review -p $GERRIT_PROJECT -m \"$(cat violation.log)\" $GERRIT_PATCHSET_REVISION --notify NONE"
               ssh -p 29418 gerrit.opnfv.org "$cmd"
 
     builders:
       - shell: |
           #!/bin/bash
-          # Install python package 
+          # Install python package
           sudo pip install "flake8==2.6.2"
 
           echo "Checking python code..."