# Copyright Andrew Tridgell 2005
# Released under the GNU GPL version 3 or later
#
-
+from __future__ import print_function
import os, sys
# make sure the script dies immediately when hitting control-C,
"""show open tree connects"""
conn = open_connection("smb_server")
tcons = next(conn.smbsrv_information(irpc.SMBSRV_INFO_TCONS))
- print "Share Client Connected at"
- print "-" * 79
+ print("Share Client Connected at")
+ print("-" * 79)
for tcon in tcons:
- print "%-30s %16s %s" % (tcon.share_name, tcon.client_ip, sys.httptime(tcon.connect_time))
+ print("%-30s %16s %s" %
+ (tcon.share_name, tcon.client_ip, sys.httptime(tcon.connect_time)))
def show_nbt(open_connection):
"""show nbtd information"""
conn = open_connection("nbt_server")
stats = next(conn.nbtd_information(irpc.NBTD_INFO_STATISTICS))
- print "NBT server statistics:"
+ print("NBT server statistics:")
fields = [("total_received", "Total received"),
("total_sent", "Total sent"),
("query_count", "Query count"),
("register_count", "Register count"),
("release_count", "Release count")]
for (field, description) in fields:
- print "\t%s:\t%s" % (description, getattr(stats, field))
- print
+ print("\t%s:\t%s" % (description, getattr(stats, field)))
+ print()
parser = optparse.OptionParser("%s [options]" % sys.argv[0])
sambaopts = options.SambaOptions(parser)
lp = sambaopts.get_loadparm()
-print "%s" % lp.get("server string")
+print("%s" % lp.get("server string"))
messaging_path = (opts.messaging_path or os.path.join(lp.get("private dir"), "smbd.tmp", "messaging"))
conn = open_connection("smb_server")
except RuntimeError, (num, msg):
if msg == 'NT_STATUS_OBJECT_NAME_NOT_FOUND':
- print "No active connections"
+ print("No active connections")
else:
show_sessions(conn)
show_tcons(conn)