def _get_ip_leases(self):
        if not self.cfg.dcnm.dcnm_dhcp_leases:
            LOG.debug('DHCP lease file is not defined.')
            return
        try:
            ssh_session = paramiko.SSHClient()
            ssh_session.set_missing_host_key_policy(paramiko.AutoAddPolicy())
            ssh_session.connect(self.cfg.dcnm.dcnm_ip,
                                username=self.cfg.dcnm.dcnm_user,
                                password=self.cfg.dcnm.dcnm_password)
        except Exception:
            LOG.exception(_LE('Failed to establish connection with DCNM.'))
            if ssh_session:
                ssh_session.close()
            return

        try:
            ftp_session = ssh_session.open_sftp()
            dhcpd_leases = ftp_session.file(self.cfg.dcnm.dcnm_dhcp_leases)
            leases = dhcpd_leases.readlines()
            ftp_session.close()
            ssh_session.close()
            return leases
        except __HOLE__:
            ftp_session.close()
            ssh_session.close()
            LOG.error(_LE('Cannot open %(file)s.'),
                      {'file': self.cfg.dcnm.dcnm_dhcp_leases})
dataset/ETHPy150Open openstack/networking-cisco/networking_cisco/apps/saf/server/dfa_server.py/DfaServer._get_ip_leases