shieldproject / shield-boshrelease

BOSH Release for shield
MIT License
11 stars 17 forks source link

Import errand don t work when not using a generated token #132

Closed jraverdy-orange closed 6 years ago

jraverdy-orange commented 6 years ago

when specifying the token in the manifest, the import errand exit with token: unbound variable error. In the run script, the sed is missing a condition on the token substitution, it should have something like this:

echo "importing now......"                  
sed -e "                                    
  s/(deployment)/<%= spec.deployment %>/g;  
  s/(index)/<%= spec.index.to_s %>/g;       
  s/(ip)/<%= spec.ip %>/g;                  
  s/(name)/<%= spec.name %>/g;              
  s/(az)/<%= spec.az || '' %>/g;            
<% if p('generate_token') %>                
  s/generated-token/$token/g;               
<%- end -%>                                 
" /var/vcap/jobs/import/config/import.yml |\
  $bin/shield import -