Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
virl-utils-hs-fulda
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sebastian Rieger
virl-utils-hs-fulda
Commits
206f9898
Commit
206f9898
authored
9 years ago
by
Sebastian Rieger
Browse files
Options
Downloads
Patches
Plain Diff
fixed typo in existing image check, bumped version
parent
c607fa84
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
create-cumulusvx-image/create-cumulus-vx-image.sh
+9
-5
9 additions, 5 deletions
create-cumulusvx-image/create-cumulus-vx-image.sh
with
9 additions
and
5 deletions
create-cumulusvx-image/create-cumulus-vx-image.sh
+
9
−
5
View file @
206f9898
#!/bin/bash
#!/bin/bash
# create-cumulus-vx-image.sh V0.
2
# create-cumulus-vx-image.sh V0.
3
# HS-Fulda - sebastian.rieger@informatik.hs-fulda.de
# HS-Fulda - sebastian.rieger@informatik.hs-fulda.de
#
#
# changelog:
# changelog:
#
#
# V0.2 - added support to delete existing image with the same name and generating the default nova flavor
# V0.2 added support to delete existing image with the same name and generating the default nova flavor
# V0.3 checking whether it is safe to unmount the working directory
# usage
# usage
if
[
!
$#
-eq
2
]
;
then
if
[
!
$#
-eq
2
]
;
then
...
@@ -46,14 +47,17 @@ function safe_unmount() {
...
@@ -46,14 +47,17 @@ function safe_unmount() {
}
}
# check for an existing image with the same name and offer to delete it prior to creating a new one
# check for an existing image with the same name and offer to delete it prior to creating a new one
CHECK_FOR_EXISTING_IMAGE
=
$(
glance image-show
CumulusVX
2>&1
)
CHECK_FOR_EXISTING_IMAGE
=
$(
glance image-show
$GLANCE_IMAGE_NAME
2>&1
)
if
[
$?
==
0
]
;
then
if
[
$?
==
0
]
;
then
glance image-show
$GLANCE_IMAGE_NAME
echo
echo
read
-r
-p
"There is already an image with the same name in glance. Do you want to overwrite it? [y/N] "
RESPONSE
read
-r
-p
"There is already an image with the same name in glance. Do you want to overwrite it? [y/N] "
RESPONSE
if
[[
$RESPONSE
=
~ ^
([
yY][eE][sS]|[yY]
)
$
]]
;
then
if
[[
$RESPONSE
=
~ ^
([
yY][eE][sS]|[yY]
)
$
]]
;
then
echo
"Deleting existing image
$
2
..."
echo
"Deleting existing image
$
GLANCE_IMAGE_NAME
..."
echo
"==========================================================="
echo
"==========================================================="
glance image-delete
$
2
glance image-delete
$
GLANCE_IMAGE_NAME
else
else
echo
"An image with the same name already exists. Either delete this image or choose another name."
echo
"An image with the same name already exists. Either delete this image or choose another name."
exit
1
exit
1
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment