pauper 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/bin/pauper +1 -0
  3. data/lib/pauper.rb +9 -0
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 870836ceaf1ad2d084cd2bda4ee48dbc010771a6
4
- data.tar.gz: 23447ec71f6cca56e9852fc829c81357d08dd185
3
+ metadata.gz: ff61589708789bacee3de7073cd4c2f796a91e06
4
+ data.tar.gz: 28071b91f41a77ca52cdcff1fb5a35ca957c8bdb
5
5
  SHA512:
6
- metadata.gz: 5d51cfe88771e94c62ae1a237a05c8ddc49d7c50778e38991fb08e2d080cb2caa1ed7a47bcb5203cff22701ef2fb5fa478e5faa5199bc0f3af891dad7d7eaac8
7
- data.tar.gz: d06fa28f5ca8fb7ee4708793f3056eaf954142c010546cf481666c8bced91110154dfb414db78c5df382b22ea47cceb6f78fe9ebc2c49b4d6349c4b714b872e2
6
+ metadata.gz: 443bdec50d5c697e5b4e0a6fce3dda6b3435dabd614c095829939f9c384e7f52622f7188e9180e550c0af8ce13a39483a8764d559243fe707d242050ae05096c
7
+ data.tar.gz: a7718fe5d5b834900e515623865e15a1b9f2e0f9bee0ab0804351a10052ba7cfa93ad46554cd608a4a1b0a3ad7a97ec4d0ec505232aa38c6980b3f1517095226
data/bin/pauper CHANGED
@@ -7,6 +7,7 @@ require 'vmx'
7
7
  require 'dhcpd'
8
8
 
9
9
  class CLI < Thor
10
+
10
11
  desc "bootstrap", "Initialize the base image"
11
12
  def bootstrap
12
13
  pauper = Pauper.new
@@ -17,12 +17,21 @@ class Pauper
17
17
  DEFAULT_VM_PATH = File.expand_path('/var/lib/lxc/')
18
18
 
19
19
  def initialize(pauperfile=DEFAULT_PAUPERFILE)
20
+ if root?
21
+ puts "Don't run as root!"
22
+ exit
23
+ end
24
+
20
25
  @pauper_config = Pauper::Config.new(DEFAULT_PAUPERFILE)
21
26
  network = LIBVIRT.new(@pauper_config.config[:subnet])
22
27
  network.enable
23
28
  @pauper_config.config[:bridge] = network.interface
24
29
  end
25
30
 
31
+ def root?
32
+ Process.euid == 0
33
+ end
34
+
26
35
  def config
27
36
  @pauper_config
28
37
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pauper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.16
4
+ version: 0.1.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler McMullen
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-06 00:00:00.000000000 Z
12
+ date: 2013-12-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: thor