def test_listShares(self):
     smb = SMBConnection('*SMBSERVER',
                         self.machine,
                         preferredDialect=self.dialects)
     smb.login(self.username, self.password, self.domain)
     smb.listShares()
     smb.logoff()
Example #2
0
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 []
Example #3
0
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 []
Example #4
0
 def test_listShares(self):
     smb = SMBConnection('*SMBSERVER', self.machine, preferredDialect = self.dialects)
     smb.login(self.username, self.password, self.domain)
     smb.listShares()
     smb.logoff()