[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Python API



That worked. Thanks so much!

On Mon, Dec 18, 2017 at 9:48 AM, Jason Patton <jpatton@xxxxxxxxxxx> wrote:
> I was able to reproduce part of the problem (though not the same error
> message) within a mostly bare CentOS 7 docker container.
>
> [root@6c1f958d20a2 /]# python
> Python 2.7.5 (default, Aug  4 2017, 00:39:18)
> [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.>>>
> import htcondor
>
> Neither the environment variable CONDOR_CONFIG,
> /etc/condor/, /usr/local/etc/, nor ~condor/ contain a condor_config source.
> Either set CONDOR_CONFIG to point to a valid config source,
> or put a "condor_config" file in /etc/condor/ /usr/local/etc/ or ~condor/
>>>> htcondor.version()
> '$CondorVersion: 8.7.4 Oct 30 2017 BuildID: UW_development $'
>>>> c = htcondor.Collector('***.wisc.edu')
>>>> c.query(htcondor.AdTypes.Collector)
> Can't find "condor" in the password file and CONDOR_IDS not defined in
> condor_config or as an environment variable.
> [root@6c1f958d20a2 /]# # python interpreter was killed
>
>
> I was able to work around this by making an empty file and pointing
> CONDOR_CONFIG to it:
>
> [root@6c1f958d20a2 /]# touch condor_config
> [root@6c1f958d20a2 /]# export CONDOR_CONFIG=$(pwd)/condor_config
> [root@6c1f958d20a2 /]# python
> Python 2.7.5 (default, Aug  4 2017, 00:39:18)
> [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>>>> import htcondor
>>>> c = htcondor.Collector('cm.chtc.wisc.edu')
>>>> c.query(htcondor.AdTypes.Collector)
> [[ RecentUpdatesTotal_Negotiator = 3; AddressV1 = ....
>
>
> Give that a try and see if it works. I will see about putting a check for
> this situation in the pip package so that it's not completely useless if it
> doesn't find a config.
>
> Jason Patton
>
> On Mon, Dec 18, 2017 at 8:31 AM, Larry Martell <larry.martell@xxxxxxxxx>
> wrote:
>>
>> OK but I get the errors I posted when I try and use the API:
>>
>> >> 12/17/17 13:12:36 ERROR "Unwilling or unable to try IPv4 or IPv6.
>> >> Check the settings ENABLE_IPV4, ENABLE_IPV6, and NETWORK_INTERFACE.
>> >> " at line 1212 in file
>> >>
>> >>
>> >> /var/lib/condor/execute/slot1/dir_5110/htcondor_source/src/condor_io/sock.cpp
>>
>> How do I fix this?
>>
>> On Mon, Dec 18, 2017 at 9:26 AM, Weiming Shi <swmtrc@xxxxxxxxx> wrote:
>> > Hi Larry,
>> >
>> > I don't think so. I think you don't need to have your client machine
>> > configured if you just use those python API that does not need to
>> > interact
>> > with the collector. But you will still get the warning message when you
>> > try
>> > to import the htcondor module.
>> > I am also seeking a way to disable this message.
>> >
>> > On Sun, Dec 17, 2017 at 1:15 PM, Larry Martell <larry.martell@xxxxxxxxx>
>> > wrote:
>> >>
>> >> I am trying to use the python API from a machine that does not have
>> >> condor installed. I did 'pip install htcondor' and now I am trying
>> >> this:
>> >>
>> >> >>> import htcondor
>> >>
>> >> Neither the environment variable CONDOR_CONFIG,
>> >> /etc/condor/, /usr/local/etc/, nor ~condor/ contain a condor_config
>> >> source.
>> >> Either set CONDOR_CONFIG to point to a valid config source,
>> >> or put a "condor_config" file in /etc/condor/ /usr/local/etc/ or
>> >> ~condor/
>> >> >>> import classad
>> >> >>> coll = htcondor.Collector("192.168.10.2")
>> >> >>> ads = coll.query(htcondor.AdTypes.Startd)
>> >> 12/17/17 13:12:36 ERROR "Unwilling or unable to try IPv4 or IPv6.
>> >> Check the settings ENABLE_IPV4, ENABLE_IPV6, and NETWORK_INTERFACE.
>> >> " at line 1212 in file
>> >>
>> >>
>> >> /var/lib/condor/execute/slot1/dir_5110/htcondor_source/src/condor_io/sock.cpp
>> >>
>> >> To use the API from a client machine like this do I have to have a
>> >> full blown installed and configured condor?