Skip to content

python cli detect imgmanip -o appears not to follow osrc/otarg map #41

@xkortex

Description

@xkortex

If I understand the spec correctly, the client should always see paths which make sense relative to its own bindmounts; likewise the server should see only valid paths to the server's mounts. That should mean that all URIs on the proto wire are with respect to the server, since all translation is handled in cli.py.

Here is what I currently observe:

client = MediforClient(src='/tmp/CLI', targ='/tmp/SERV', )
req = ImageManipulationRequest(image={'uri': '/tmp'})
resp = client.img_manip('/tmp/CLI/in/hi.txt', '/tmp/CLI/out')
print('_________')
print('I am Client. I see Response:\n {}'.format(resp))

Out:

I am Server. I see Request:
 request_id: "d1de5fa4-c3ea-4068-a8e5-7b91036aa94e"
image {
  uri: "/tmp/SERV/in/hi.txt"
}
out_dir: "/tmp/SERV/out"

_________
I am Client. I see Response:
 localization {
  mask {
    uri: "/tmp/SERV/in/hi.txt.d"
  }
}

However, what I expect is:

I am Server. I see Request:
 request_id: "60c2c38a-8a28-4fa3-b724-861ac296fddb"
image {
  uri: "/tmp/SERV/in/hi.txt"
}
out_dir: "/tmp/SERV/out"

_________
I am Client. I see Response:
 localization {
  mask {
    uri: "/tmp/CLI/in/hi.txt.d"
  }
}

It would appear there is code somewhat like this missing in mediforclient.py:img_manip, mediforclient.py:vid_manip, and perhaps elsewhere :

        out_uri = self.o_unmap(resp.localization.mask.uri)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions