[CalendarServer-changes] [13977] CalendarServer/trunk
source_changes at macosforge.org
source_changes at macosforge.org
Thu Sep 18 07:34:36 PDT 2014
Revision: 13977
http://trac.calendarserver.org//changeset/13977
Author: cdaboo at apple.com
Date: 2014-09-18 07:34:36 -0700 (Thu, 18 Sep 2014)
Log Message:
-----------
Whitespace.
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/diagnose.py
CalendarServer/trunk/calendarserver/tools/test/test_diagnose.py
CalendarServer/trunk/twistedcaldav/customxml.py
Modified: CalendarServer/trunk/calendarserver/tools/diagnose.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/diagnose.py 2014-09-18 14:33:43 UTC (rev 13976)
+++ CalendarServer/trunk/calendarserver/tools/diagnose.py 2014-09-18 14:34:36 UTC (rev 13977)
@@ -44,6 +44,7 @@
"""
+
def usage(e=None):
if e:
print(e)
@@ -60,13 +61,14 @@
sys.exit(0)
+
def main():
if os.getuid() != 0:
usage("This program must be run as root")
try:
- (optargs, args) = getopt(
+ optargs, _ignore_args = getopt(
sys.argv[1:], "h", [
"help",
],
@@ -146,12 +148,13 @@
showWebApps()
+
def showProcesses():
print()
print("Calendar and Contacts service processes:")
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/bin/ps", "ax",
"-o user",
"-o pid",
@@ -167,12 +170,13 @@
print(line)
+
def showServerctlStatus():
print()
print("Serverd status:")
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/Applications/Server.app/Contents/ServerRoot/usr/sbin/serverctl",
"list",
)
@@ -203,12 +207,13 @@
)
+
def showDiskSpace(serverRoot):
print()
print("Disk space on boot volume:")
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/bin/df",
"-H",
"/",
@@ -217,7 +222,7 @@
print("Disk space on service data volume:")
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/bin/df",
"-H",
serverRoot
@@ -225,7 +230,7 @@
print(stdout)
print("Disk space used by Calendar and Contacts service:")
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/usr/bin/du",
"-sh",
os.path.join(serverRoot, "Config"),
@@ -235,6 +240,7 @@
print(stdout)
+
def showPostgresStatus(serverRoot):
clusterPath = os.path.join(serverRoot, "Data", "Database.xpg", "cluster.pg")
@@ -260,9 +266,10 @@
return True
+
def runSQLQuery(query):
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, stderr = runCommand(
"/Applications/Server.app/Contents/ServerRoot/usr/bin/psql",
"-h",
"/var/run/caldavd/PostgresSocket",
@@ -276,9 +283,10 @@
print(stderr)
+
def countFromSQLQuery(query):
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/Applications/Server.app/Contents/ServerRoot/usr/bin/psql",
"-h",
"/var/run/caldavd/PostgresSocket",
@@ -291,9 +299,10 @@
return count
+
def listDatabases():
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, stderr = runCommand(
"/Applications/Server.app/Contents/ServerRoot/usr/bin/psql",
"-h",
"/var/run/caldavd/PostgresSocket",
@@ -307,6 +316,7 @@
print(stderr)
+
def showPostgresContent():
print()
@@ -337,12 +347,13 @@
print("Number of group delegate assignments: {}".format(count))
+
def showConfigKeys():
print()
print("Configuration:")
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/Applications/Server.app/Contents/ServerRoot/usr/sbin/calendarserver_config",
"EnableCalDAV",
"EnableCardDAV",
@@ -409,18 +420,20 @@
return child.returncode, output, error
+
def getOSBuild():
try:
- code, stdout, stderr = runCommand("/usr/bin/sw_vers", "-buildVersion")
+ code, stdout, _ignore_stderr = runCommand("/usr/bin/sw_vers", "-buildVersion")
if not code:
return stdout.strip()
except:
return "Unknown"
+
def getServerBuild():
try:
- code, stdout, stderr = runCommand("/usr/sbin/serverinfo", "--buildversion")
+ code, stdout, _ignore_stderr = runCommand("/usr/sbin/serverinfo", "--buildversion")
if not code:
return stdout.strip()
except:
@@ -428,6 +441,7 @@
return "Unknown"
+
def getServerRoot():
"""
Return the ServerRoot value from the servermgr_calendar.plist. If not
@@ -447,6 +461,7 @@
return "Unknown"
+
def checkPlist(plistPath):
if not os.path.exists(plistPath):
raise FileNotFound
@@ -459,11 +474,12 @@
return True
+
def showWebApps():
print()
print("Web apps:")
- code, stdout, stderr = runCommand(
+ _ignore_code, stdout, _ignore_stderr = runCommand(
"/Applications/Server.app/Contents/ServerRoot/usr/sbin/webappctl",
"status",
"-"
@@ -479,7 +495,7 @@
def getPasswordFromKeychain(account):
- code, stdout, stderr = runCommand(
+ code, _ignore_stdout, stderr = runCommand(
"/usr/bin/security",
"find-generic-password",
"-a",
@@ -563,6 +579,7 @@
return True
+
def connectToCaldavd(keys):
print()
Modified: CalendarServer/trunk/calendarserver/tools/test/test_diagnose.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/test/test_diagnose.py 2014-09-18 14:33:43 UTC (rev 13976)
+++ CalendarServer/trunk/calendarserver/tools/test/test_diagnose.py 2014-09-18 14:34:36 UTC (rev 13977)
@@ -31,5 +31,6 @@
self.assertEquals(stderr, "")
self.assertTrue("total" in stdout)
+
def test_runCommand_nonExistent(self):
self.assertRaises(FileNotFound, runCommand, "/xyzzy/plugh/notthere")
Modified: CalendarServer/trunk/twistedcaldav/customxml.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/customxml.py 2014-09-18 14:33:43 UTC (rev 13976)
+++ CalendarServer/trunk/twistedcaldav/customxml.py 2014-09-18 14:34:36 UTC (rev 13977)
@@ -817,7 +817,6 @@
-
@registerElement
class AutoScheduleMode (WebDAVTextElement):
"""
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140918/78c40453/attachment.html>
More information about the calendarserver-changes
mailing list