GithubHelp home page GithubHelp logo

rackspace_lbaas's People

Contributors

theborch avatar

Watchers

 avatar

rackspace_lbaas's Issues

Repeated pattern could be factored out

This pattern happens a lot in the library:

    def create_node(id = retrieve_lb_id, addr, port)
      return if check_node_exists(id, addr, port)
      begin
        <do something>
      rescue <various errors>
        <log some stuff>
      end
    end

Perhaps you could abstract that out into its own method that accepts a block, and then just pass the various specifics into the more generic method. You'd do this under the hood, still having the end users see the nice method names, but underneath, you'd really have very simple logic.

Get rid of poise, have real idempotency

I'd challenge you to drop the poise dependencies like https://github.com/theborch/rackspace_lbaas/blob/master/libraries/provider_load_balancer.rb. I don't think you're really taking advantage of anything major, and you'd get one major benefit: true idempotency.

Currently, that provider's actions always run, instead of:

  • load current resource
  • see if it needs updating
  • only run action if needed

If someone were to set a notifies on the current resources and providers, they'd fire every time, even if the load balancer or LB node wasn't modified. You'd also get a much nicer why-run mode, where you could tell the chef-run / chef-client if you're really going to make an API call.

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.