Browse code

Merge "exit cleanup in functions"

Jenkins authored on 2013/10/23 06:33:39
Showing 1 changed files
... ...
@@ -580,7 +580,8 @@ function git_clone {
580 580
     if echo $GIT_REF | egrep -q "^refs"; then
581 581
         # If our branch name is a gerrit style refs/changes/...
582 582
         if [[ ! -d $GIT_DEST ]]; then
583
-            [[ "$ERROR_ON_CLONE" = "True" ]] && exit 1
583
+            [[ "$ERROR_ON_CLONE" = "True" ]] && \
584
+                die $LINENO "Cloning not allowed in this configuration"
584 585
             git clone $GIT_REMOTE $GIT_DEST
585 586
         fi
586 587
         cd $GIT_DEST
... ...
@@ -588,7 +589,8 @@ function git_clone {
588 588
     else
589 589
         # do a full clone only if the directory doesn't exist
590 590
         if [[ ! -d $GIT_DEST ]]; then
591
-            [[ "$ERROR_ON_CLONE" = "True" ]] && exit 1
591
+            [[ "$ERROR_ON_CLONE" = "True" ]] && \
592
+                die $LINENO "Cloning not allowed in this configuration"
592 593
             git clone $GIT_REMOTE $GIT_DEST
593 594
             cd $GIT_DEST
594 595
             # This checkout syntax works for both branches and tags
... ...
@@ -612,8 +614,7 @@ function git_clone {
612 612
             elif [[ -n "`git show-ref refs/remotes/origin/$GIT_REF`" ]]; then
613 613
                 git_update_remote_branch $GIT_REF
614 614
             else
615
-                echo $GIT_REF is neither branch nor tag
616
-                exit 1
615
+                die $LINENO "$GIT_REF is neither branch nor tag"
617 616
             fi
618 617
 
619 618
         fi
... ...
@@ -1563,7 +1564,6 @@ function _ping_check_novanet() {
1563 1563
         else
1564 1564
             die $LINENO "[Fail] Could ping server"
1565 1565
         fi
1566
-        exit 1
1567 1566
     fi
1568 1567
 }
1569 1568
 
... ...
@@ -1576,7 +1576,6 @@ function get_instance_ip(){
1576 1576
     if [[ $ip = "" ]];then
1577 1577
         echo "$nova_result"
1578 1578
         die $LINENO "[Fail] Coudn't get ipaddress of VM"
1579
-        exit 1
1580 1579
     fi
1581 1580
     echo $ip
1582 1581
 }