I have a script which remaps broken feature class layers from file geodatabase to sde. It works fine, but there's something weird in the string for the remapped layers that I cannot figure out.
These are the broken file geodatabase layers:
ChrisHolmes_0-1618938142356.png
The script remaps them correctly to sde, but I'm seeing this:
ChrisHolmes_3-1618938652354.png
And what I want is this:
ChrisHolmes_4-1618938982332.png
Does anyone have any idea why the file geodatabase path is on the end?
These are the properties I'm setting to remap the layers to sde:
ChrisHolmes_5-1618939574355.png
Note that I have replaced the following properties with dummy values for the purposes of this thread: db_connection_properties; instance; server; user; dataset
Here is the procedure that is doing the work:
def UpdateSdeConnectionProperties(self, fcName, brokenLayer, userN=None):
new_conn_prop = brokenLayer.connectionProperties
new_conn_prop['connection_info']['authentication_mode'] = self.sdeAuthMode
new_conn_prop['connection_info']['db_connection_properties'] = self.sdeDbConnProps
new_conn_prop['connection_info']['dbclient'] = self.sdeDbClient
new_conn_prop['connection_info']['instance'] = self.sdeInstance
new_conn_prop['connection_info']['projectInstance'] = self.sdeProjInstance
new_conn_prop['connection_info']['server'] = self.sdeServer
if userN is not None:
new_conn_prop['connection_info']['user'] = userN
new_conn_prop['connection_info']['version'] = self.sdeVersion
new_conn_prop['dataset'] = fcName
new_conn_prop['workspace_factory'] = self.sdeWsFactory
# Update the connection properties dictionary of the layer
brokenLayer.updateConnectionProperties(brokenLayer.connectionProperties,new_conn_prop)
Thanks for looking everyone!