From 98c5bfb36fa05048bdab18b9dc2aa26d1ac70bcb Mon Sep 17 00:00:00 2001 From: Louis de Vandiere Date: Tue, 15 Aug 2017 13:17:58 -0700 Subject: [PATCH] FIX - revert command to check if partition exists --- .../alien-extended-storage-types.yml | 2 +- alien-extended-storage-types/scripts/parted.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/alien-extended-storage-types/alien-extended-storage-types.yml b/alien-extended-storage-types/alien-extended-storage-types.yml index 3f9337f..ffd6508 100644 --- a/alien-extended-storage-types/alien-extended-storage-types.yml +++ b/alien-extended-storage-types/alien-extended-storage-types.yml @@ -2,7 +2,7 @@ tosca_definitions_version: alien_dsl_1_4_0 metadata: template_name: alien-extended-storage-types - template_version: 1.4.1-SNAPSHOT + template_version: 1.4.2-SNAPSHOT template_author: alien4cloud imports: diff --git a/alien-extended-storage-types/scripts/parted.sh b/alien-extended-storage-types/scripts/parted.sh index 12aa303..758eb6c 100644 --- a/alien-extended-storage-types/scripts/parted.sh +++ b/alien-extended-storage-types/scripts/parted.sh @@ -4,9 +4,9 @@ partition_number=1 device_name=${DEVICE} echo "Checking existing partition for $device_name" -sudo parted --script $device_name print 2>/dev/null | grep "Partition Table: unknown" -PARTITION_UNKNOWN=$(echo $?) -if [ $PARTITION_UNKNOWN -eq 0 ] ; then +sudo fdisk -l $device_name 2>/dev/null | grep -E "$device_name[0-9]" +PARTITION_EXISTENCE=$(echo $?) +if [ $PARTITION_EXISTENCE -ne 0 ] ; then echo "Creating disk partition gpt on device ${device_name}" sudo parted --script $device_name \ mklabel gpt \