[omniORB] [help] [beginner] cannot run naming service examples
from python chapter 2 "The Basics"
Duncan Grisby
duncan at grisby.org
Thu Sep 1 13:00:56 BST 2011
On Thu, 2011-09-01 at 16:29 +1200, Alistair Bayley wrote:
> > They should be, yes. What is in /etc/hosts ?
>
> 127.0.0.1 localhost
> 127.0.1.1 abayley-desktop desktop
> 172.30.135.152 pyramid1
> 172.30.135.153 wsoss1
> 172.30.135.154 pyramid2
> 172.30.135.151 wsoss2
> 172.30.135.155 fms-poll-1
>
> and then some ipv6 stuff.
What's in the IPv6 stuff? Another reference for localhost perhaps?
> > Can you upgrade to omniORB 4.1.6? That has better logging of name
> > resolution, and has some changed logic around use of resolved names that
> > may fix the issue.
>
> Not easily. I prefer to use the distribution (ubuntu 10.04) packages,
> and the machine I will deploy on has even older versions of python and
> omniorb. I'm satisfied with using 127.0.0.1 for testing; when I deploy
> to our dev environment, it all runs ok, so this problem is localised
> top my machine.
Well can you campaign to get a modern version of omniORB into Ubuntu
then? 4.1.2 is three and a half years old now.
> BTW, how is one meant to construct python objects from IDL enums? I
> have this IDL:
>
> enum Status {ok, late, failed};
>
> which generates this python code:
It's a really bad idea to look at the generated code. It's ugly and
confusing. You should just read the Python mapping spec and trust that
omniORBpy follows it correctly:
http://www.omg.org/spec/PYTH/1.2/
> How do I get from a Status value to the matching integer e.g.
> fmsWatchdog.ok => 0 ?
Why do you want the integer value of it? You are meant to just use the
symbolic name. As the Python mapping says in section 1.3.3:
"An enumeration is mapped into a number of constant objects in
the name space where the enumeration is defined. An application
may only test for equivalence of two enumeration values, and not
assume that they behave like numbers."
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the omniORB-list
mailing list