Ejemplo n.º 1
0
    def update_gpos(self, username):
        gpos = self.get_gpos(username)

        try:
            check_refresh_gpo_list(self.selected_dc, self.lp, self.creds, gpos)
        except Exception as exc:
            logging.error(
                slogm('Unable to refresh GPO list for {} from {}'.format(
                    username, self.selected_dc)))
        return gpos
Ejemplo n.º 2
0
    def test_check_refresh_gpo_list(self):
        cache = self.lp.cache_path('gpo_cache')
        ads = gpo.ADS_STRUCT(self.server, self.lp, self.creds)
        if ads.connect():
            gpos = ads.get_gpo_list(self.creds.get_username())
        check_refresh_gpo_list(self.server, self.lp, self.creds, gpos)

        self.assertTrue(os.path.exists(cache),
                        'GPO cache %s was not created' % cache)

        guid = '{31B2F340-016D-11D2-945F-00C04FB984F9}'
        gpt_ini = os.path.join(cache, policies, guid, 'GPT.INI')
        self.assertTrue(os.path.exists(gpt_ini),
                        'GPT.INI was not cached for %s' % guid)
Ejemplo n.º 3
0
    def update_gpos(self, username):
        gpos = self.get_gpos(username)

        try:
            log('D49')
            check_refresh_gpo_list(self.selected_dc, self.lp, self.creds, gpos)
            log('D50')
        except Exception as exc:
            logdata = dict()
            logdata['username'] = username
            logdata['dc'] = self.selected_dc
            logdata['err'] = str(exc)
            log('F1')
            raise exc
        return gpos