Commit f3e412f9 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

python lib: rename rpc.py to rpc_pb2.py

Unfortunately, newer versions of protobuf check that the file suffix ends
in _pb2.py:

sudo ./zdtm.py run -t zdtm/static/apparmor_stacking
Traceback (most recent call last):
  File "./zdtm.py", line 23, in <module>
    import criu as crpc
  File "/home/ubuntu/criu/test/criu.py", line 12, in <module>
    import rpc
  File "/home/ubuntu/criu/test/rpc.py", line 36, in <module>
    type=None),
  File "/usr/lib/python2.7/dist-packages/google/protobuf/descriptor.py", line 652, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors should not be created directly, but only retrieved from their parent.

v2: fix up the clean target, and remove some comments that were about the
    old rename
Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
CC: Laurent Dufour <ldufour@linux.vnet.ibm.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent dd3a9012
all: images rpc.py
all: images rpc_pb2.py
.PHONY: all images clean
images:
$(Q) $(MAKE) -C images all
# rpc_pb2.py doesn't depend on any other file, so
# it is safe to rename it, dropping ugly _pb2 suffix.
rpc.py:
$(Q) protoc -I=$(SRC_DIR)/images/ --python_out=./ $(SRC_DIR)/images/$(@:.py=.proto)
$(Q) mv $(@:.py=_pb2.py) $@
rpc_pb2.py:
$(Q) protoc -I=$(SRC_DIR)/images/ --python_out=./ $(SRC_DIR)/images/$(@:_pb2.py=.proto)
clean:
$(Q) $(MAKE) -C images clean
$(Q) $(RM) rpc.py *.pyc
$(Q) $(RM) rpc_pb2.py *.pyc
import rpc
import rpc_pb2 as rpc
import images
from criu import *
......@@ -9,7 +9,7 @@ import signal
import sys
import struct
import rpc
import rpc_pb2 as rpc
class _criu_comm:
"""
......
../lib/py/rpc.py
\ No newline at end of file
../lib/py/rpc_pb2.py
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment