Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX - revert command to check if partition exists #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions alien-extended-storage-types/scripts/parted.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down