Skip to content

Commit

Permalink
Merge pull request #151 from sudeeshjohn/script
Browse files Browse the repository at this point in the history
Fixing the object name parsing
  • Loading branch information
Power Cloud Robot authored Jul 21, 2021
2 parents 858ebd1 + abaf83c commit 1375d1e
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,10 @@ function standardize_object_name {
local object_temp_name=""
object_extension="ova.gz"
object_temp_name=${object_original_name%.*}
IMAGE_NAME=`echo $object_temp_name | sed 's/\.//g'| sed 's/ppc64le//g'|sed 's/ova//g'|sed 's/qcow2//g' | sed 's/openstack//g' | sed 's/kvm//g' | sed -e 's/---*//g' | sed -e 's/_/-/g'| sed -e 's/[0-9]-GenericCloud-//g' | tr '[:upper:]' '[:lower:]' | grep -o -E '^[a-z]*-[0-9]{2}'`-$(date +%m%d%Y)
OBJECT_NAME=$IMAGE_NAME.${object_extension}
os_name=`echo $object_temp_name |sed 's/\.//g'|tr '[:upper:]' '[:lower:]' |grep -o -E '^rhcos-|^rhel-|^centos-' | sed 's/-//'`
os_version_date=`echo $object_temp_name | sed 's/\.//g'| sed 's/ppc64le|qcow2|ova|openstack|kvm|GenericCloud//g' | sed -e 's/---*//g' | sed -e 's/_/-/g'| sed -e 's/[0-9]-GenericCloud-//g' | tr '[:upper:]' '[:lower:]' | grep -o -E '^[a-z]*-[0-9]{2}'|sed -E 's/rhel|rhcos|centos//g'`-$(date +%m%d%Y)
IMAGE_NAME=$os_name$os_version_date
OBJECT_NAME=$os_name$os_version_date.${object_extension}
}


Expand Down

0 comments on commit 1375d1e

Please sign in to comment.