File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -167,7 +167,27 @@ getInstanceName()
167167
168168getDeviceList ()
169169{
170- echo -e " $( gcloud $OPT_ACCOUNT compute disks list $1 --filter " $FILTER_CLAUSE " --format=' value(name,zone,id)' $OPT_PROJECT ) "
170+ # echo -e "$(gcloud $OPT_INSTANCE_SERVICE_ACCOUNT compute disks list --filter "users~instances/$1\$ $FILTER_CLAUSE" --format='value(name)')"
171+
172+ local filter=" "
173+
174+ # if using remote instances (-r), then no name filter is required
175+ if [ " $REMOTE_CLAUSE " = true ]; then
176+
177+ # check if $FILTER_CLAUSE exists
178+ if [[ ! -z $FILTER_CLAUSE ]]; then
179+ filter=" ${FILTER_CLAUSE} "
180+ fi
181+ else
182+ # check if $FILTER_CLAUSE exists
183+ if [[ ! -z $FILTER_CLAUSE ]]; then
184+ filter=" name:$1 AND ${FILTER_CLAUSE} "
185+ else
186+ filter=" name:$1 "
187+ fi
188+ fi
189+
190+ echo -e " $( gcloud $OPT_ACCOUNT compute disks list --filter " ${filter} " --format=' value(name,zone,id)' $OPT_PROJECT ) "
171191}
172192
173193
You can’t perform that action at this time.
0 commit comments