我这里有两个类,TDUtility和CreateMAPInConfig。我想使用方法" enable_logons"在" drop_map"方法。我该怎么办?
类TDUtility(对象):
def __init__(self,system,path):
self.__host = system
self.__LogDIR__ = path
def enable_logons(self, ena_logons_log):
cmd = "/usr/bin/tdsh -l root "+self.__host+" 'echo 'enable logons' | /usr/pde/bin/cnscons'"
类CreateMAPInConfig(object):
def __init__(self,system,path):
self.__host = system
self.__LogDIR__ = path
def drop_map(self, auto_select, map_name):
TDUtility().enable_logons("enable_logs3")
答案 0 :(得分:1)
在drop_map的定义中,您必须指定系统和路径。如果它们是您的CreateMAPInConfig中的代码,则代码应如下所示:' drop_map':
TDUtility(self.__host, self.__LogDIR__).enable_logons("enable_logs3")