Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
intranet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nounous-archives
intranet
Commits
0acc91dd
Commit
0acc91dd
authored
Oct 10, 2017
by
Charlie Jacomme
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update_printer: stop yelling you son of a cron
parent
c0568af2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
printer/models.py
printer/models.py
+9
-7
No files found.
printer/models.py
View file @
0acc91dd
...
...
@@ -24,13 +24,15 @@ class Printer(models.Model):
self
.
save
()
def
update_printer_information
(
self
):
try
:
for
paper_tray
in
self
.
paper_trays
.
all
():
paper_tray
.
update_from_snmp
()
for
supply
in
self
.
supplies
.
all
():
supply
.
update_from_snmp
()
self
.
refresh_alerts
()
# Since the number of alert is changing we refresh instead of update
self
.
update_from_snmp
()
except
SNMPException
(
err
):
print
err
def
refresh_paper_trays
(
self
):
for
paper_tray
in
self
.
paper_trays
.
all
():
paper_tray
.
delete
()
...
...
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