Skip to content

Commit

Permalink
fix preload errors
Browse files Browse the repository at this point in the history
  • Loading branch information
MauriceManning committed Dec 11, 2012
2 parents 9e09ed7 + 507b9ba commit 8fc8410
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions ion/processes/bootstrap/ion_loader.py
Expand Up @@ -1198,8 +1198,6 @@ def _load_InstrumentSite_OOI(self):

def _load_StreamDefinition(self, row):
res_obj = self._create_object_from_row("StreamDefinition", row, "sdef/")
# sd_module = row["StreamContainer_module"]
# sd_method = row["StreamContainer_method"]
pname = row["param_dict_name"]
svc_client = self._get_service_client("dataset_management")
parameter_dictionary_id = svc_client.read_parameter_dictionary_by_name(pname, id_only=True,
Expand All @@ -1208,7 +1206,7 @@ def _load_StreamDefinition(self, row):
res_id = svc_client.create_stream_definition(name=res_obj.name, parameter_dictionary_id=parameter_dictionary_id,
headers=self._get_system_actor_headers())
self._register_id(row[self.COL_ID], res_id)

def _load_ParameterDefs(self, row):
param_type = row['Parameter Type']
if param_type == 'record':
Expand Down Expand Up @@ -1267,7 +1265,7 @@ def _load_ParameterDictionary(self, row):
try:
context_ids = [dataset_management.read_parameter_context_by_name(i)._id for i in contexts]
temporal_parameter = row['temporal_parameter'] or ''
dataset_management.create_parameter_dictionary(name=row['name'],
dataset_management.create_parameter_dictionary(name=row['name'],
parameter_context_ids=context_ids,
temporal_context=temporal_parameter,
headers=self._get_system_actor_headers())
Expand Down
6 changes: 4 additions & 2 deletions ion/services/dm/distribution/pubsub_management_service.py
Expand Up @@ -42,7 +42,9 @@ def create_stream_definition(self, name='', parameter_dictionary=None, parameter
return existing[0]
raise Conflict('StreamDefinition with the specified name already exists. (%s)' % name)

if not name: create_unique_identifier()
if not name:
create_unique_identifier()
# name = create_unique_identifier()

stream_definition = StreamDefinition(parameter_dictionary=parameter_dictionary, stream_type=stream_type, name=name, description=description)
stream_definition_id,_ = self.clients.resource_registry.create(stream_definition)
Expand All @@ -60,7 +62,7 @@ def read_stream_definition(self, stream_definition_id='', stream_id=''):
else:
raise NotFound('No Stream Definition is associated with this Stream')
stream_definition = retval or self.clients.resource_registry.read(stream_definition_id)
pdicts, _ = self.clients.resource_registry.find_objects(subject=stream_definition._id, object_type=RT.ParameterDictionaryResource, id_only=True)
pdicts, _ = self.clients.resource_registry.find_objects(subject=stream_definition._id, predicate=PRED.hasParameterDictionary, object_type=RT.ParameterDictionaryResource, id_only=True)
if len(pdicts):
stream_definition.parameter_dictionary = DatasetManagementService.get_parameter_dictionary(pdicts[0]).dump()
validate_is_instance(stream_definition,StreamDefinition)
Expand Down
2 changes: 0 additions & 2 deletions ion/services/sa/product/data_product_management_service.py
Expand Up @@ -44,8 +44,6 @@ def create_data_product(self, data_product=None, stream_definition_id='', parame
res, _ = self.clients.resource_registry.find_resources(restype=RT.DataProduct, name=data_product.name, id_only=True)
validate_false(len(res), 'A data product with the name %s already exists.' % data_product.name)
log.info('Creating DataProduct: %s', data_product.name)
log.debug('%s', data_product.__dict__)


# Create will validate and register a new data product within the system
# If the stream definition has a parameter dictionary, use that
Expand Down

0 comments on commit 8fc8410

Please sign in to comment.