I have written a custom GUI that allows the user to publish a feature layer that is tied into a web map. I have made the web map public. When any updates to the feature layer happen I have to republish the feature layer so that the updates make it into the web map and eventually our website. I have had to manually go in to the feature layers setting to make it public. Everytime I use the GUI to publish the feature layer it reverts the 'Share' settings and no longer makes it public like I want it to be.
Is the code for my arcpy.UploadServiceDefinition_server corect to make a feature layer public (three lines up from the bottom)?