AnsweredAssumed Answered

Confirming Network Analyst Extension is Checked Out

Question asked by LongC@chesterfield.gov_ChesterfieldVA on May 16, 2018
Latest reply on May 16, 2018 by LongC@chesterfield.gov_ChesterfieldVA

Hello all,

 

I'm working on a python script that utilizes the Network Analyst Extension, so at the beginning of the script I check that extension out. I think its working but I want a way to confirm the users actually has that extension. Below is the code where I check it out but I'm looking for some code that will list the user who has the extension or confirm that the user successfully checked it out. Is that possible?

 

#Check out the Network Analyst extension license
    class LicenseError(Exception):
        pass

    try:
        if arcpy.CheckExtension("Network") == "Available":
            arcpy.CheckOutExtension("Network")
        else:
            raise LicenseError

        # Script runs here

        except LicenseError:
            logger.info("License Not Available")

Outcomes