- repo ||= Repository.create(name: repo_name) # create repo, if does not already exist
- logger.info { "repo uuid: " + repo[:uuid] }
-
- repo_perm = Link.create(tail_kind: 'arvados#user',
- tail_uuid: @object[:uuid],
- head_kind: 'arvados#repository',
- head_uuid: repo[:uuid],
- link_class: 'permission',
- name: 'can_write')
- logger.info { "repo permission: " + repo_perm[:uuid] }
- end
-
- # create login permission for the given vm_uuid, if it does not already exist
- def create_vm_login_permission_link(vm_uuid, repo_name)
- # Look up the given virtual machine just to make sure it really exists.
- begin
- vm = (vms = VirtualMachine.where(uuid: vm_uuid)) != nil ? vms.first : nil
- if not vm
- logger.warn "Could not look up virtual machine with uuid #{vm_uuid.inspect}"
- return
- end
-
- logger.info { "vm uuid: " + vm[:uuid] }