'Create a registry'

def create(self):

    results = []
    self.needs_update()
    if (self.deploymentconfig is None):
        results.append(self._create(self.prepared_registry['deployment_file']))
    elif self.prepared_registry['deployment_update']:
        results.append(self._replace(self.prepared_registry['deployment_file']))
    if (self.service is None):
        results.append(self._create(self.prepared_registry['service_file']))
    elif self.prepared_registry['service_update']:
        results.append(self._replace(self.prepared_registry['service_file']))
    rval = 0
    for result in results:
        if (('returncode' in result) and (result['returncode'] != 0)):
            rval = result['returncode']
    return {'returncode': rval, 'results': results}
