def test_listShares(self): smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect=self.dialects) smb.login(self.username, self.password, self.domain) smb.listShares() smb.logoff()
def safe_enumshares(smb): try: return [ share['shi1_netname'][:-1] for share in smb.listShares() ] except Exception as e: if verbose: logger.error("Got exception while getting shares: %s" % e) return []
def safe_enumshares(smb): try: return [share["shi1_netname"][:-1] for share in smb.listShares()] except Exception as e: if verbose: logger.error("Got exception while getting shares: %s" % e) return []
def test_listShares(self): smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect = self.dialects) smb.login(self.username, self.password, self.domain) smb.listShares() smb.logoff()