Coder Social home page Coder Social logo

Comments (5)

coderanger avatar coderanger commented on June 8, 2024

Two things

  1. Does that query work in knife? (knife search client 'name:test*')
  2. Any reason you aren't using result.object?

from pychef.

behemphi avatar behemphi commented on June 8, 2024

Sorry it took so long to get back to you.

In answer to 1
Surprising only sort of. As seen below the knife search client 'name:staging*' is a valid command but the result returned is unexpected. According to the doc (http://wiki.opscode.com/display/chef/Search) it should work (see the table at the top)

I reported this to Opscode.

Here is a session:

boyd@kitchen:/opt/feedmagnet 03:05:16 > knife search node "name:staging*"
2 items found

Node Name:   staging
Environment: QA
FQDN:        staging
IP:          50.57.66.212
Run List:    role[deployment-host]
Roles:       deployment-host
Recipes      chef-client::config, chef-client::delete_validation, base, mysql, python, console-server, revealcloud, ntp
Platform:    ubuntu 10.04

Node Name:   stagingutil
Environment: QA
FQDN:        stagingutil
IP:          50.57.65.178
Run List:    role[magnet-host]
Roles:       magnet-host
Recipes      chef-client::config, chef-client::delete_validation, base, magnet-server, revealcloud, ntp
Platform:    ubuntu 10.04

boyd@kitchen:/opt/feedmagnet 03:06:34 > knife search client "*:*" | grep staging
name:        stagingutil
name:        staging
boyd@kitchen:/opt/feedmagnet 03:06:56 > knife search client "name:staging*"
0 items found

Regarding 2
I think this is simply me still wrapping my head around Python. WHen I look at base.from_search I see that it is returning an object. However when I tried to work with the object I encountered errors I could not reconcile. When I got the name of the thing and then acquired the object (as above) all was happy.

If you have a code snippet handy to demonstrate what you are talking about, I would certainly appreciate it.

Thank you for your time Noah.

from pychef.

coderanger avatar coderanger commented on June 8, 2024

Is this against your own chef-server or Hosted Chef? If it is your own, double check that chef-expander is running. Also try running a full reindex using knife.

As for a code sample, this should be equivalent to the above:

for result in chef.Search('client', q="name:test*"):
    print result.object

from pychef.

coderanger avatar coderanger commented on June 8, 2024

Regardless this doesn't sound like a PyChef issue if knife is showing the same anomalous results.

from pychef.

behemphi avatar behemphi commented on June 8, 2024

Noah:

Thanks for the quick reply.

THe problem was against hosted chef. I did file a support ticket last
night at the same time I do agree this is a chef issue not a PyChef issue
and I am sorry for the trouble.

Boyd

On Wed, Jun 20, 2012 at 3:09 AM, Noah Kantrowitz <
[email protected]

wrote:

Regardless this doesn't sound like a PyChef issue if knife is showing the
same anomalous results.


Reply to this email directly or view it on GitHub:
#10 (comment)

Best Regards
Boyd Hemphill
Chief Systems Architect
www.feedmagnet.com
[email protected]
(512) 470-6146

from pychef.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.