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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Francois Le Corre
slapos.package
Commits
cd0d7240
Commit
cd0d7240
authored
Feb 24, 2014
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[slapos.package] slapos/package/update.py Pyflaked
parent
053ec74a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
8 deletions
+3
-8
slapos/package/update.py
slapos/package/update.py
+3
-8
No files found.
slapos/package/update.py
View file @
cd0d7240
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
##############################################################################
##############################################################################
#
#
# Copyright (c) 2012 Vifib SARL and Contributors.
# Copyright (c) 2012
-2014
Vifib SARL and Contributors.
# All Rights Reserved.
# All Rights Reserved.
#
#
# WARNING: This program as such is intended to be used by professional
# WARNING: This program as such is intended to be used by professional
...
@@ -28,14 +28,10 @@
...
@@ -28,14 +28,10 @@
#
#
##############################################################################
##############################################################################
import
ConfigParser
import
datetime
import
datetime
import
logging
import
logging
from
optparse
import
OptionParser
,
Option
from
optparse
import
OptionParser
,
Option
import
os
import
subprocess
as
sub
import
sys
import
sys
import
tempfile
from
signature
import
Signature
from
signature
import
Signature
from
base_promise
import
BasePromise
from
base_promise
import
BasePromise
...
@@ -98,7 +94,6 @@ class Upgrader:
...
@@ -98,7 +94,6 @@ class Upgrader:
self
.
logger
.
addHandler
(
ch
)
self
.
logger
.
addHandler
(
ch
)
def
fixConsistency
(
self
,
signature
,
upgrade
=
0
,
reboot
=
0
,
boot
=
0
,
**
kw
):
def
fixConsistency
(
self
,
signature
,
upgrade
=
0
,
reboot
=
0
,
boot
=
0
,
**
kw
):
print
upgrade
,
reboot
,
boot
today
=
datetime
.
date
.
today
().
isoformat
()
today
=
datetime
.
date
.
today
().
isoformat
()
if
upgrade
and
boot
:
if
upgrade
and
boot
:
signature
.
update
(
reboot
=
today
,
upgrade
=
today
)
signature
.
update
(
reboot
=
today
,
upgrade
=
today
)
...
@@ -140,7 +135,7 @@ class Upgrader:
...
@@ -140,7 +135,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
:
...
@@ -153,7 +148,7 @@ class Upgrader:
...
@@ -153,7 +148,7 @@ class Upgrader:
if
fixit
:
if
fixit
:
self
.
fixConsistency
(
signature
,
upgrade
=
1
)
self
.
fixConsistency
(
signature
,
upgrade
=
1
)
else
:
else
:
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
:
...
...
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