ExtremeCloud IQ- Site Engine & Extreme Management Center

 View Only

 workflow permissions

Jump to Best Answer
bar's profile image
bar posted 06-14-2022 04:08
I have written a workflow which works when I run it manually as an "XIQ-Operator" user.
It fails when it runs as a scheduled job because:
IOError: (13, 'Permission denied', u'/usr/local/Extreme_Networks/NetSight/appdata/logs/scripting/NetSight Server/WAP_port_has_1_or_less_VLAN_report-2022-06-13_17-31-44.txt')
When I run the job it writes to 'my' user directory:
/usr/local/Extreme_Networks/NetSight/appdata/logs/scripting/user_name/WAP_port_has_1_or_less_VLAN_report-2022-06-13_17-31-44.txt
presumably because the job gets run by "NetSight Server" when scheduled.

I can't see why the permissions are wrong.  The directory has the same persmissions as other user directories, and it does have files inside that look like they have been created by other workflows.

Does anyone have any ideas?
thanks in advance,
bar's profile image
bar Best Answer
The problem was that the path was being created in the script by using the user name variable:
userName = emc_vars["userName"]
    
wf_name=emc_vars["workflowName"].replace(' ','_')
wf_dateTime=time.strftime('%Y-%m-%d_%H-%M-%S',time.localtime(int(emc_vars["workflowUpdatedDateTime"])/1000))
    
    
output_dir = os.path.join("/usr/local/Extreme_Networks/NetSight/appdata/logs/scripting/",userName)​
The user that runs the scheduled jobs is "NetSight Server" with a space!
The associated directory is NetSight_Server with an underscore.

I've hard coded the path for now to get around the problem.

regards,