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
de1f38bb
Commit
de1f38bb
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
selecting of repo in isrepo is smarter
parent
5fd63e37
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/isrepo
+8
-5
8 additions, 5 deletions
bin/isrepo
installsystems/config.py
+2
-2
2 additions, 2 deletions
installsystems/config.py
with
10 additions
and
7 deletions
bin/isrepo
+
8
−
5
View file @
de1f38bb
...
...
@@ -83,12 +83,15 @@ try:
args
=
p_main
.
parse_args
()
# load config
config
=
ConfigFile
(
"
isrepo
"
,
args
.
config
)
# get config repositories
repos
=
config
.
repos
# filtering on repository name if present
if
args
.
repo_name
is
not
None
:
repos
=
filter
(
lambda
x
:
x
.
name
==
args
.
repo_name
,
config
.
repos
)
else
:
repos
=
config
.
repos
if
len
(
repos
)
==
1
:
args
.
repo
=
repos
[
repos
.
keys
()[
0
]
]
elif
args
.
repo_name
in
repos
.
keys
()
:
args
.
repo
=
repos
[
args
.
repo_name
]
args
.
repo
=
repos
[
0
]
elif
len
(
repos
)
>
1
:
raise
Exception
(
"
Please select a repository with -r
"
)
else
:
raise
Exception
(
"
No image repository found
"
)
debug
(
"
Image repo: %s
"
%
args
.
repo
.
image
)
...
...
This diff is collapsed.
Click to expand it.
installsystems/config.py
+
2
−
2
View file @
de1f38bb
...
...
@@ -49,7 +49,7 @@ class ConfigFile(object):
if
"
image
"
not
in
cp
.
options
(
rep
):
continue
# get all options in repo
self
.
_repos
.
append
(
RepositoryConfig
(
rep
,
**
dict
(
cp
.
items
(
rep
))))
self
.
_repos
.
append
(
RepositoryConfig
(
rep
,
**
dict
(
cp
.
items
(
rep
))))
except
Exception
as
e
:
raise
raise
Exception
(
"
Unable load file %s: %s
"
%
(
self
.
path
,
e
))
...
...
@@ -89,6 +89,6 @@ class ConfigFile(object):
@property
def
repos
(
self
):
'''
Get a
dic
t of repository available
'''
'''
Get a
lis
t of repository available
'''
# deep copy
return
list
(
self
.
_repos
)
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