~awstools-dev/ubuntu/maverick/ec2-ami-tools/maverick

« back to all changes in this revision

Viewing changes to lib/ec2/platform/base.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-10-14 08:35:25 UTC
  • Revision ID: james.westby@ubuntu.com-20081014083525-c0n69wr7r7aqfb8w
Tags: 1.3-26357-0ubuntu2
* New upstream version.
* Update the debian copyright file.
* Added quilt patch system to make it easier to maintain. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2008 Amazon.com, Inc. or its affiliates.  All Rights
 
2
# Reserved.  Licensed under the Amazon Software License (the
 
3
# "License").  You may not use this file except in compliance with the
 
4
# License. A copy of the License is located at
 
5
# http://aws.amazon.com/asl or in the "license" file accompanying this
 
6
# file.  This file is distributed on an "AS IS" BASIS, WITHOUT
 
7
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
 
8
# the License for the specific language governing permissions and
 
9
# limitations under the License.
 
10
 
 
11
#------------------------------------------------------------------------------
 
12
module EC2
 
13
  module Platform
 
14
    module Base
 
15
      module Distribution
 
16
        UNKNOWN   = 'Unknown'
 
17
        GENERIC   = 'Generic'
 
18
      end
 
19
      class System
 
20
        MOUNT_POINT = '/mnt/img-mnt'
 
21
        def self.distribution
 
22
          Distribution::UNKNOWN
 
23
        end
 
24
        
 
25
        def self.superuser?
 
26
          false
 
27
        end
 
28
        
 
29
        def self.exec(cmd, debug)
 
30
          if debug
 
31
            puts( "Executing: #{cmd} " )
 
32
            suffix = ''
 
33
          else
 
34
            suffix = ' 2>&1 > /dev/null'
 
35
          end
 
36
          raise "execution failed: \"#{cmd}\"" unless system( cmd + suffix )
 
37
        end
 
38
      end
 
39
    end
 
40
  end
 
41
end