[Git][NTPsec/ntpsec][master] Address GitLab issur #589: AttributeError: 'Process' object has no attribute 'ionice'

Eric S. Raymond gitlab at mg.gitlab.com
Wed Jun 19 14:29:36 UTC 2019



Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
fbc20154 by Eric S. Raymond at 2019-06-19T14:20:05Z
Address GitLab issur #589: AttributeError: 'Process' object has no attribute 'ionice'

- - - - -


1 changed file:

- ntpclients/ntpviz.py


Changes:

=====================================
ntpclients/ntpviz.py
=====================================
@@ -1593,7 +1593,10 @@ Python by ESR, concept and gnuplot code by Dan Drown.
             import psutil
             # set ionice() to idle
             p = psutil.Process(os.getpid())
-            p.ionice(psutil.IOPRIO_CLASS_IDLE)
+            try:
+                p.ionice(psutil.IOPRIO_CLASS_IDLE)
+            except AttributeError:
+                sys.stderr.write("ntpviz: INFO: ionice is not available\n")
 
         except ImportError:
             if 0 < args.debug_level:



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fbc2015460939c0befd2940ff125d4e85bc320ab

-- 
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/fbc2015460939c0befd2940ff125d4e85bc320ab
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20190619/51de2719/attachment.htm>


More information about the vc mailing list