Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Christian Rebischke
arch-boxes
Commits
031e245d
Unverified
Commit
031e245d
authored
Jan 03, 2020
by
Christian Rebischke
Browse files
fix bug #71
parent
abb54295
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitignore
View file @
031e245d
...
...
@@ -2,3 +2,4 @@ packer_cache/
*.box
*.swp
output-*
.vscode
controller.py
View file @
031e245d
...
...
@@ -12,8 +12,7 @@ import subprocess
import
os.path
API_URL
=
'https://app.vagrantup.com/api/v1/box/archlinux/archlinux'
NOW
=
datetime
.
datetime
.
now
()
THIS_MONTH
=
int
(
NOW
.
strftime
(
"%m"
))
NOW
=
datetime
.
date
.
today
()
LEN_RELEASES
=
2
CWD
=
'/srv/arch-boxes/arch-boxes'
ISO_PATH
=
'/srv/ftp/iso/latest/archlinux-'
+
NOW
.
strftime
(
...
...
@@ -58,8 +57,12 @@ def determine_missing_release(release_providers):
def
is_latest
(
release_version
):
release_month
=
int
(
release_version
.
split
(
"."
)[
1
])
return
THIS_MONTH
<=
release_month
# we need to use .date() here, otherwise the compare is going to fail
release
=
datetime
.
datetime
.
strptime
(
release_version
,
"%Y.%m.%d"
).
date
()
# set the day to 1, because we only want to check for month and year
release
=
release
.
replace
(
day
=
1
)
current_release
=
NOW
.
replace
(
day
=
1
)
return
current_release
<=
release
def
all_released
(
release_providers
):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment