Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
slapos.package
Commits
92d2920c
Commit
92d2920c
authored
Feb 28, 2014
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos.package: Use do_upgrade and not main
This was a legacy when it was used as script directly
parent
19f30348
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
10 deletions
+8
-10
setup.py
setup.py
+1
-1
slapos/package/update.py
slapos/package/update.py
+7
-9
No files found.
setup.py
View file @
92d2920c
...
@@ -29,7 +29,7 @@ setup(name=name,
...
@@ -29,7 +29,7 @@ setup(name=name,
'console_scripts'
:
[
'console_scripts'
:
[
# Those entry points are development version and
# Those entry points are development version and
# self updatable API
# self updatable API
'slappkg-update-raw = slapos.package.update:
main
'
,
'slappkg-update-raw = slapos.package.update:
do_update
'
,
'slappkg-discover-raw = slapos.package.distribution:do_discover'
,
'slappkg-discover-raw = slapos.package.distribution:do_discover'
,
'slappkg-upload-key-raw = slapos.package.upload_key:main'
,
'slappkg-upload-key-raw = slapos.package.upload_key:main'
,
'slappkg-update = slapos.package.autoupdate:do_update'
,
'slappkg-update = slapos.package.autoupdate:do_update'
,
...
...
slapos/package/update.py
View file @
92d2920c
...
@@ -123,11 +123,11 @@ class Upgrader:
...
@@ -123,11 +123,11 @@ class Upgrader:
"You need upgrade and/or reboot when invoke fixConsistency!"
)
"You need upgrade and/or reboot when invoke fixConsistency!"
)
def
checkConsistency
(
self
,
fixit
=
0
,
**
kw
):
def
checkConsistency
(
self
,
fixit
=
0
,
**
kw
):
# Get configuration
# Get configuration
signature
=
Signature
(
self
.
config
)
signature
=
Signature
(
self
.
config
)
signature
.
load
()
signature
.
load
()
self
.
logger
.
debug
(
"Expected Reboot early them %s"
%
signature
.
reboot
)
self
.
logger
.
debug
(
"Expected Reboot early them %s"
%
signature
.
reboot
)
self
.
logger
.
debug
(
"Expected Upgrade early them %s"
%
signature
.
upgrade
)
self
.
logger
.
debug
(
"Expected Upgrade early them %s"
%
signature
.
upgrade
)
self
.
logger
.
debug
(
"Last reboot : %s"
%
signature
.
last_reboot
)
self
.
logger
.
debug
(
"Last reboot : %s"
%
signature
.
last_reboot
)
...
@@ -136,7 +136,7 @@ class Upgrader:
...
@@ -136,7 +136,7 @@ class Upgrader:
if
signature
.
upgrade
>
datetime
.
date
.
today
():
if
signature
.
upgrade
>
datetime
.
date
.
today
():
self
.
logger
.
debug
(
"Upgrade will happens on %s"
%
signature
.
upgrade
)
self
.
logger
.
debug
(
"Upgrade will happens on %s"
%
signature
.
upgrade
)
return
return
# Check if run for first time
# Check if run for first time
if
signature
.
last_reboot
is
None
:
if
signature
.
last_reboot
is
None
:
if
fixit
:
if
fixit
:
...
@@ -149,13 +149,13 @@ class Upgrader:
...
@@ -149,13 +149,13 @@ class Upgrader:
self
.
fixConsistency
(
signature
,
upgrade
=
1
)
self
.
fixConsistency
(
signature
,
upgrade
=
1
)
else
:
else
:
self
.
logger
.
info
(
"Your system is up to date"
)
self
.
logger
.
info
(
"Your system is up to date"
)
if
signature
.
last_reboot
<
signature
.
reboot
:
if
signature
.
last_reboot
<
signature
.
reboot
:
if
not
self
.
config
.
dry_run
:
if
not
self
.
config
.
dry_run
:
self
.
fixConsistency
(
signature
,
reboot
=
1
)
self
.
fixConsistency
(
signature
,
reboot
=
1
)
else
:
else
:
self
.
logger
.
debug
(
"Dry run: Rebooting required."
)
self
.
logger
.
debug
(
"Dry run: Rebooting required."
)
def
run
(
self
):
def
run
(
self
):
"""
"""
...
@@ -163,8 +163,8 @@ class Upgrader:
...
@@ -163,8 +163,8 @@ class Upgrader:
machine if needed
machine if needed
"""
"""
self
.
checkConsistency
(
fixit
=
not
self
.
config
.
dry_run
)
self
.
checkConsistency
(
fixit
=
not
self
.
config
.
dry_run
)
def
main
():
def
do_update
():
"""Update computer and slapos"""
"""Update computer and slapos"""
usage
=
"usage: %s [options] "
%
sys
.
argv
[
0
]
usage
=
"usage: %s [options] "
%
sys
.
argv
[
0
]
# Parse arguments
# Parse arguments
...
@@ -172,5 +172,3 @@ def main():
...
@@ -172,5 +172,3 @@ def main():
upgrader
.
run
()
upgrader
.
run
()
sys
.
exit
()
sys
.
exit
()
if
__name__
==
'__main__'
:
main
()
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