HMAC_KEY未设置警告

时间:2012-08-02 14:38:41

标签: python pyro

我正在尝试example from pyro docs,我得到了

argon@vprime:~/py/pyro$ python greeting.py 
/usr/local/lib/python2.7/dist-packages/Pyro4-4.14-py2.7.egg/Pyro4/core.py:155: UserWarning: HMAC_KEY not set, protocol data may not be secure
  warnings.warn("HMAC_KEY not set, protocol data may not be secure")
Ready. Object uri = PYRO:obj_1e83aa04124a4e808be18c6ca839d5fd@localhost:48766

如何避免这种情况? (尽管如此,这个例子仍有效)

另外,如何分离pyro的守护进程?

并且 - example with name server无效:

argon@vprime:~/py/pyro$ python name_server.py 
/usr/local/lib/python2.7/dist-packages/Pyro4-4.14-py2.7.egg/Pyro4/core.py:155: UserWarning: HMAC_KEY not set, protocol data may not be secure
  warnings.warn("HMAC_KEY not set, protocol data may not be secure")
Traceback (most recent call last):
  File "name_server.py", line 11, in <module>
    ns=Pyro4.locateNS()                   # find the name server
  File "/usr/local/lib/python2.7/dist-packages/Pyro4-4.14-py2.7.egg/Pyro4/naming.py", line 323, in locateNS
    raise Pyro4.errors.NamingError("Failed to locate the nameserver")
Pyro4.errors.NamingError: Failed to locate the nameserver

1 个答案:

答案 0 :(得分:2)

应该有pyro4.config.HMAC_KEY ='the_same_string_for_server_and_client'如所述...在pyro-docs中某处(丢失了)