Esri / ArcREST

python package for REST API (AGS, AGOL, webmap JSON, etc..)
Apache License 2.0
192 stars 155 forks source link

copy_feature_service_def.py Type Error #245

Closed brianjbaldwin closed 8 years ago

brianjbaldwin commented 8 years ago

ArcRest

Version or date of download

5/17/2016

Bug

error on line: line 104 error in file name: C:\Users\bria7556\Box Sync\Baldwin\GitHub\ArcREST Scripts\copy_feature_service_def.py with error message: TypeError: 'NoneType' object has no attribute 'getitem'

Repo Steps or Enhancement details

Error with the copy_feature_service_def.py

pLeBlanc93 commented 8 years ago

@brianjbaldwin #246 adds a few changes to reflect new syntax from 3.0.1 to the current version. If fs.syncCapabilities is None, accessing the sub keys will fail. I temporarily enabled sync on the FS and it works correctly now, but the final res returns something like:

{u'error':
{u'message': u'Unable to add feature service definition.',
u'code': 400, u'details': [u'Invalid definition for System.Collections.Generic.List`1[ESRI.ArcGIS.SDS.Metadata.LayerCoreInfo]',
u'Exception has been thrown by the target of an invocation.']}}

@MikeMillerGIS , is this because of syntax changes to .addtoDefinition()?

MikeMillerGIS commented 8 years ago

I would try the copy_feature_service_deforgorg.py versions, it has more checks in it

pLeBlanc93 commented 8 years ago

@brianjbaldwin copy_feature_service_def.py has been removed in favor of copy_feature_service_deforgorg.py as it has more functionality (can copy between orgs) and better checks.

achapkowski commented 8 years ago

code merged.