bryanthowell-tableau / tableau_tools

Package containing Tableau REST API, XML modification, tabcmd and repository tools
Other
215 stars 87 forks source link

recursion depth error creating AD group #95

Open rloomer opened 4 years ago

rloomer commented 4 years ago

Calling create_group_from_ad_group is returning "maximum recursion depth exceeded while calling a Python object". It's occurring at the point the supplied default_site_role is getting validated against the available site_roles in TableauRestApiBase. But it appears that the recursion error is being cause by the fact that self._site_roles (note the underscore before site_roles) does not exist in TableauRestApiBase which defines it as self.site_roles without the underscore.

From group.py

# Creating a synced ad group is completely different, use this method
# The luid is only available in the Response header if bg sync. Nothing else is passed this way -- how to expose?
def create_group_from_ad_group(self, ad_group_name: str, ad_domain_name: str,
                               default_site_role: Optional[str] = 'Unlicensed',
                               sync_as_background: bool = True) -> str:
    self.start_log_block()
    if default_site_role not in self._site_roles:
        raise InvalidOptionException('"{}" is not an acceptable site role'.format(default_site_role))

From rest_api_base.py

    self.site_roles = (
        u'Interactor',
        u'Publisher',
        u'SiteAdministrator',
        u'Unlicensed',
        u'UnlicensedWithPublish',  # This was sunset at some point
        u'Viewer',
        u'ViewerWithPublish',
        u'ServerAdministrator',
        u'ReadOnly',
        u'Explorer',
        u'ExplorerCanPublish',
        u'SiteAdministratorExplorer',
        u'Creator',
        u'SiteAdministratorCreator'
    )