summaryrefslogtreecommitdiff
path: root/cloudinit/config/cc_power_state_change.py
diff options
context:
space:
mode:
authorHarm Weites <harm@weites.com>2013-12-14 19:16:05 +0000
committerHarm Weites <harm@weites.com>2013-12-14 19:16:05 +0000
commit8a2b80adfb66f9036dc617ff65b7f6ab4464ca5d (patch)
tree4617e6132878241744b2c8e784f2a4609e4b3411 /cloudinit/config/cc_power_state_change.py
parentbd96af406f268e3fe41537125be4cf2dfc9ea5bc (diff)
downloadvyos-cloud-init-8a2b80adfb66f9036dc617ff65b7f6ab4464ca5d.tar.gz
vyos-cloud-init-8a2b80adfb66f9036dc617ff65b7f6ab4464ca5d.zip
change: Use util.system_info().
Diffstat (limited to 'cloudinit/config/cc_power_state_change.py')
-rw-r--r--cloudinit/config/cc_power_state_change.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/cloudinit/config/cc_power_state_change.py b/cloudinit/config/cc_power_state_change.py
index 46ce5ba5..8efef24b 100644
--- a/cloudinit/config/cc_power_state_change.py
+++ b/cloudinit/config/cc_power_state_change.py
@@ -23,7 +23,6 @@ import errno
import os
import re
import subprocess
-import sys
import time
frequency = PER_INSTANCE
@@ -44,7 +43,7 @@ def givecmdline(pid):
# Example output from procstat -c 16357
# PID COMM ARGS
# 1 init /bin/init --
- if sys.platform.startswith('freebsd'):
+ if util.system_info()["platform"].startswith('FreeBSD'):
(output, _err) = util.subp(['procstat', '-c', str(pid)])
line = output.splitlines()[1]
m = re.search('\d+ (\w|\.|-)+\s+(/\w.+)', line)