Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
Managetests
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gruppo Web
Managetests
Commits
cd25203c
Commit
cd25203c
authored
Mar 02, 2019
by
Mattia Rizzolo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make possible to start without a branches dir
Signed-off-by:
Mattia Rizzolo
<
mattia@debian.org
>
parent
ed9c1f9c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
managetests/utils.py
managetests/utils.py
+10
-6
No files found.
managetests/utils.py
View file @
cd25203c
# A program which manages Ubuntu-it's web test server
# Copyright (C) 2015 Pietro Albini <pietroalbini@ubuntu.com>
# © 2019 Mattia Rizzolo <mapreri@ubuntu.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
...
...
@@ -25,15 +26,18 @@ def is_root_valid(path):
path
=
pathlib
.
Path
(
path
)
if
not
(
path
.
exists
()
and
path
.
is_dir
()):
print
(
")he specified root directory doesn't exist, please create it."
)
return
False
required_dirs
=
[
"branches"
]
required_files
=
[
"config.json"
,
"details.json"
,
"version"
]
for
dir
in
required_dirs
:
dir
=
path
/
dir
if
not
(
dir
.
exists
()
and
dir
.
is_dir
()):
print
(
"The required directory %s does not exist"
%
dir
)
# make sure a branches directory is available:
dir
=
path
/
'branches'
if
not
dir
.
exists
():
print
(
'Creating the branches directory...'
)
dir
.
mkdir
()
elif
not
dir
.
is_dir
():
print
(
'There is a branches file conflicting with the expected directory'
)
return
False
for
file
in
required_files
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment