cleanfb 0.1.0 → 0.1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cleanfb/version.rb +1 -1
  3. data/lib/cleanfb.rb +15 -13
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f80c8961f648f2a503a19083ba5005ed4b930bdf
4
- data.tar.gz: ec9fb051c544114f296212781000199ac74149a7
3
+ metadata.gz: fc0f0b04bcea2764c34be59e7ba024a2753139cb
4
+ data.tar.gz: 3d7f8a78111e923c18503f86f7e704d853deed50
5
5
  SHA512:
6
- metadata.gz: 5e37cf3ae4a85e45bb9e01582dfe3e8c887a0b36b73ea8d6462b61a750002990e68623916495a2e4e085bce2a7951d2ecfc92ecc898a333f493f48747f13daf9
7
- data.tar.gz: 739d1053eee6544ded5bd46af537044bcfbfa249dae4ae09f47ec3c7baf3292ee79a5aff866aaf7054ed07ae2d4e0fc1862a14a9354ce5fc6dec393c01b3c34d
6
+ metadata.gz: 416fb7eb7ff5e8a2d08baceb4aeb17ad402e7829e4d04c91e3a74a05f50f35dc2b03f97f0c7cd7fa85c5c78110bc75e9ed6f2a991ad9fa8b258cf865dbd7d77c
7
+ data.tar.gz: 733e23f0539bf770876a1bde307aeb03245c281fc3c98bb7f719e9fe950461525672ae673cc5b609faffd19dd53f46d1a3133c3f949b6c161352b8dd078bcd7e
@@ -1,3 +1,3 @@
1
1
  module Cleanfb
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1.1"
3
3
  end
data/lib/cleanfb.rb CHANGED
@@ -5,30 +5,32 @@ module Cleanfb
5
5
  class Clean
6
6
  def remove()
7
7
  return "Please supply a file" if ARGV[0].nil? || ARGV[0].empty?
8
- return "Removes an agent's backups from the Puppet filebucket on the server.\nEx: cleanfb client\n options: -h or --help | help and information\n -y | defaults all input to yes" if (!ARGV[1].nil? and (ARGV[1] == "-h" or ARGV[1] == "--help"))
9
-
8
+
9
+ if (ARGV[0] == "-h" or ARGV[0] == "--help")
10
+ return "Removes an agent's backups from the Puppet filebucket on the server.\nEx: cleanfb client\n options: -h or --help | help and information\n -y | defaults all input to yes"
11
+ end
10
12
  arg = ARGV[0]
11
13
  if !ARGV[1].nil? and ARGV[1] == "-y"
12
- ans = "y"
14
+ ans = "y"
13
15
  else
14
16
  print "Remove #{arg} ? y|n: "
15
- ans = STDIN.gets.chomp
17
+ ans = STDIN.gets.chomp
16
18
  end
17
19
  if ans == "y" || ans == "yes"
18
20
  cmd = `puppet filebucket list -l|grep -i #{arg}`
19
- unless cmd.nil? || cmd.empty?
20
- cmd.each_line do |line|
21
- folders = "/opt/puppetlabs/puppet/cache/bucket"
22
- sum = line.split(" ")[0]
23
- folders += "/" + sum[0] + "/" + sum[1] + "/" + sum[2] + "/" + sum[3] + "/" + sum[4] + "/" + sum[5] + "/" + sum[6] + "/" + sum[7] + "/"
21
+ unless cmd.nil? || cmd.empty?
22
+ cmd.each_line do |line|
23
+ folders = "/opt/puppetlabs/puppet/cache/bucket"
24
+ sum = line.split(" ")[0]
25
+ folders += "/" + sum[0] + "/" + sum[1] + "/" + sum[2] + "/" + sum[3] + "/" + sum[4] + "/" + sum[5] + "/" + sum[6] + "/" + sum[7] + "/"
24
26
  folders += sum + "/"
25
27
  puts "Removing " + folders
26
- cmd = `rm -rf #{folders}`
27
- end
28
+ cmd = `rm -rf #{folders}`
29
+ end
28
30
  else
29
31
  puts "No file #{arg} found."
30
- end
31
- end
32
+ end
33
+ end
32
34
  return
33
35
  end
34
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cleanfb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - lhoffl