summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel DeLeo <dan@opscode.com>2011-03-15 17:17:12 -0700
committerDaniel DeLeo <dan@opscode.com>2011-03-15 17:17:12 -0700
commit333a74a64860df896b915559570f70a4b8f40683 (patch)
treef0a5660d1b39f716090db56dac3fbf549053a101
parent6bea580d4ecb3854cbbb2ce9d3758ab35ab041f2 (diff)
downloadchef-333a74a64860df896b915559570f70a4b8f40683.tar.gz
remove way outdated code
-rw-r--r--chef/config/server.rb15
-rw-r--r--chef/examples/user_index.pl115
-rw-r--r--chef/examples/user_index.rb27
3 files changed, 0 insertions, 157 deletions
diff --git a/chef/config/server.rb b/chef/config/server.rb
deleted file mode 100644
index add545ec84..0000000000
--- a/chef/config/server.rb
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# Example Chef Server Config
-
-log_level :debug
-
-cookbook_path File.join(File.dirname(__FILE__), "..", "examples", "config", "cookbooks")
-sandbox_path File.join(File.dirname(__FILE__), "..", "examples", "config", "sandboxes")
-sandbox_path File.join(File.dirname(__FILE__), "..", "examples", "config", "checksums")
-node_path File.join(File.dirname(__FILE__), "..", "examples", "config", "nodes")
-file_store_path File.join(File.dirname(__FILE__), "..", "examples", "store")
-openid_cstore_path File.join(File.dirname(__FILE__), "..", "examples", "openid-cstore")
-
-# openid_providers [ "localhost:4001", "openid.hjksolutions.com" ]
-
-Mixlib::Log::Formatter.show_time = false
diff --git a/chef/examples/user_index.pl b/chef/examples/user_index.pl
deleted file mode 100644
index e78a8125f4..0000000000
--- a/chef/examples/user_index.pl
+++ /dev/null
@@ -1,115 +0,0 @@
-#!/usr/bin/perl
-#
-# M00se on the L00se
-
-package Chef::Rest;
-
-use strict;
-use warnings;
-
-use LWP::UserAgent;
-use URI;
-use Params::Validate qw(:all);
-use JSON::Syck;
-
-sub new {
- my $self = shift;
- my %p = validate(@_,
- {
- content_type => { type => SCALAR },
- },
- );
- my $ref = {
- 'ua' => LWP::UserAgent->new,
- 'content_type' => $p{'content_type'},
- };
- bless $ref, $self;
-}
-
-sub load {
- my $self = shift;
- my $data = shift;
- return JSON::Syck::Load($data);
-}
-
-sub get {
- my $self = shift;
- my %p = validate(@_,
- {
- url => { type => SCALAR },
- params => { type => ARRAYREF, optional => 1 },
- },
- );
-
- my $url = URI->new($p{'url'});
- if (defined($p{'params'})) {
- $url->query_form($p{'params'});
- }
- my $req = HTTP::Request->new('GET' => $url);
- $req->content_type($self->{'content_type'});
- return $self->ua->request($req);
-}
-
-sub delete {
- my $self = shift;
- my %p = validate(@_,
- {
- url => { type => SCALAR },
- },
- );
- my $req = HTTP::Request->new('DELETE' => $p{'url'});
- $req->content_type($self->{'content_type'});
- return $self->ua->request($req);
-}
-
-sub put {
- my $self = shift;
- my %p = validate(@_,
- {
- url => { type => SCALAR },
- data => 1,
- },
- );
- my $data = JSON::Syck::Dump($p{'data'});
- my $req = HTTP::Request->new('PUT' => $p{'url'});
- $req->content_type($self->{'content_type'});
- $req->content_length(do { use bytes; length($data) });
- $req->content($data);
- return $self->ua->request($req);
-}
-
-sub post {
- my $self = shift;
- my %p = validate(@_,
- {
- url => { type => SCALAR },
- data => { required => 1 },
- },
- );
- my $data = JSON::Syck::Dump($p{'data'});
- my $req = HTTP::Request->new('POST' => $p{'url'});
- $req->content_type($self->{'content_type'});
- $req->content_length(do { use bytes; length($data) });
- $req->content($data);
- return $self->{ua}->request($req);
-}
-
-my $rest = Chef::Rest->new(content_type => 'application/json');
-
-while (my @passwd = getpwent) {
- print "Ensuring we have $passwd[0]\n";
- $rest->post(
- url => 'http://localhost:4000/search/user/entries',
- data => {
- id => $passwd[0],
- name => $passwd[0],
- uid => $passwd[2],
- gid => $passwd[3],
- gecos => $passwd[6],
- dir => $passwd[7],
- shell => $passwd[8],
- change => '',
- expire => $passwd[9],
- }
- )
-}
diff --git a/chef/examples/user_index.rb b/chef/examples/user_index.rb
deleted file mode 100644
index 485cff81b8..0000000000
--- a/chef/examples/user_index.rb
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env ruby
-#
-# Create a users index, based on /etc/passwd
-
-require 'etc'
-require File.join(File.dirname(__FILE__), "..", "lib", "chef")
-
-Chef::Config[:log_level] = :info
-r = Chef::REST.new("http://localhost:4000")
-
-users = Array.new
-Etc.passwd do |passwd|
- Chef::Log.info("Ensuring we have #{passwd.name}")
- r.post_rest("search/user/entries",
- {
- :id => passwd.name,
- :name => passwd.name,
- :uid => passwd.uid,
- :gid => passwd.gid,
- :gecos => passwd.gecos,
- :dir => passwd.dir,
- :shell => passwd.shell,
- :change => passwd.change,
- :expire => passwd.expire
- }
- )
-end