rkrahl / auto-patch Goto Github PK
View Code? Open in Web Editor NEWAutomatically install security and other system updates
License: Apache License 2.0
Automatically install security and other system updates
License: Apache License 2.0
There should be a test suite.
Documentation is virtually non existent. There should at least be a manual page for the auto-patch
script.
There are several things that need configuration in the script:
lock_max_tries
and lock_wait
,All of this is currently hard coded in the script, but should be made configurable in a configuration file.
Should improve diagnostics:
Add better error handling. Write a meaningful error message to stderr rather then letting Python emit the stack trace from the unhandled exception.
Add logging. Log relevant events such as zypper calls and return codes with level DEBUG. Log fatal errors (e.g. unhandled exceptions, see above) with level CRITICAL. Log to stderr with level DEBUG if it is a tty and to syslog with level WARN.
Thought you might want to see this. If zypper is already running, you will get exit 7 from it.
Was thinking a wait loop to attempt might get around that.
server6:/opt/auto-patch # /usr/sbin/auto-patch.py
Traceback (most recent call last):
File "/usr/sbin/auto-patch.py", line 88, in
if patch(stdout=tmpf):
File "/usr/sbin/auto-patch.py", line 67, in patch
if Zypper.patch_check(stdout=stdout) == 0:
File "/usr/sbin/auto-patch.py", line 41, in patch_check
return cls.call(args, stdout=stdout, retcodes={100, 101})
File "/usr/sbin/auto-patch.py", line 31, in call
proc.check_returncode()
File "/usr/lib64/python3.8/subprocess.py", line 444, in check_returncode
raise CalledProcessError(self.returncode, self.args, self.stdout,
subprocess.CalledProcessError: Command '['/usr/bin/zypper', '--quiet', '--non-interactive', 'patch-check']' returned non-zero exit status 7.
#1 and #4 improved handling of return codes from zypper
for two special cases. Yet there are still several error conditions from zypper
left to be dealt with. In most cases the proper reaction will probably be just throwing an error, which is what also happens now. But the return codes from zypper
should at least translated into an intelligible error message.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.