Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
1d2c507b
Commit
1d2c507b
authored
13 years ago
by
Sebastien Luttringer
Browse files
Options
Downloads
Patches
Plain Diff
better check before move image
move command now ask for a global move and check if source repository are local
parent
d95ed36b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/is
+19
-12
19 additions, 12 deletions
bin/is
with
19 additions
and
12 deletions
bin/is
+
19
−
12
View file @
1d2c507b
...
...
@@ -345,18 +345,25 @@ def c_move(args):
'''
repoman
=
load_repositories
(
args
)
dstrepo
=
repoman
[
args
.
repository
]
for
srcimg
,
srcrepo
in
get_images
(
args
.
pattern
,
repoman
,
local
=
False
):
if
not
args
.
force
:
out
(
"
You will move %s v%s from %s to %s
"
%
(
srcimg
.
name
,
srcimg
.
version
,
srcrepo
.
config
.
name
,
dstrepo
.
config
.
name
))
if
not
confirm
():
raise
Exception
(
"
Aborted!
"
)
arrow
(
"
Moving %s v%s from repository %s to %s
"
%
(
srcimg
.
name
,
srcimg
.
version
,
srcrepo
.
config
.
name
,
dstrepo
.
config
.
name
))
todo
=
list
(
get_images
(
args
.
pattern
,
repoman
,
local
=
False
,
min
=
1
))
# check all source repository are local (need by deletion)
for
img
,
repo
in
todo
:
if
not
repo
.
local
:
raise
Exception
(
"
Repository %s is not local. Unable to move
"
%
repo
.
config
.
name
)
# check user really want to this
if
not
args
.
force
:
out
(
"
You will copy and remove the following images:
"
)
for
img
,
repo
in
todo
:
out
(
"
%s/%s:%s
"
%
(
repo
.
config
.
name
,
img
.
name
,
img
.
version
))
out
(
"
Inside repository: #l##b#%s#R#
"
%
dstrepo
.
config
.
name
)
if
not
confirm
():
raise
Exception
(
"
Aborted!
"
)
# move it for real
for
srcimg
,
srcrepo
in
todo
:
arrow
(
"
Moving %s v%s from repository %s to %s
"
%
(
srcimg
.
name
,
srcimg
.
version
,
srcrepo
.
config
.
name
,
dstrepo
.
config
.
name
))
arrowlevel
(
1
)
dstrepo
.
add
(
srcimg
)
srcrepo
.
delete
(
srcimg
.
name
,
srcimg
.
version
)
...
...
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