1) Remove trailing whitespace
2) Switch some tabs to spaces (like the rest of the code)
3) Add some whitespace between arguments.
Signed-off-by: Chris Lalancette <clalance(a)redhat.com>
---
Documentation/FAQ.markdown | 24 ++++++++--------
Documentation/INSTALL.markdown | 10 +++---
Documentation/QMF.markdown | 56 +++++++++++++++++++-------------------
Documentation/man/imagefactory.1 | 18 +++++-------
imgfac/ReservationManager.py | 8 +++---
imgfac/builders/FedoraBuilder.py | 16 +++++-----
imgfac/builders/RHELBuilder.py | 17 +++++------
7 files changed, 72 insertions(+), 77 deletions(-)
diff --git a/Documentation/FAQ.markdown b/Documentation/FAQ.markdown
index dd029bd..dad7e4c 100644
--- a/Documentation/FAQ.markdown
+++ b/Documentation/FAQ.markdown
@@ -1,43 +1,43 @@
# Frequently Asked Questions #
## Installation ##
-1. Q: How do I install image_factory?
+1. Q: How do I install image_factory?
A: The simplest approach is to install from rpm. To read about creating the rpm
and/or other installation options, please read the
[
INSTALL](https://github.com/aeolusproject/image_factory/blob/master/Docum...
document in the Documentation directory of source distribution.
## Configuration ##
-1. Q: Where does the configuration live?
+1. Q: Where does the configuration live?
A: `/etc/imagefactory.conf`
-2. Q: Where does imagefactory log by default?
+2. Q: Where does imagefactory log by default?
A: `/var/log/imagefactory.log`
-3. Q: Where does Image Factory put the images that are created?
+3. Q: Where does Image Factory put the images that are created?
A: There are really three parts to this answer...
-
+
1. Image Factory stores a local copy of the image in the path pointed to by the
configuration option `imgdir`, which defaults to `/var/tmp`
2. Oz caches .iso files in `/var/lib/oz`
3. If an Image Warehouse is configured and the JEOS was created by Image Factory, the
resulting image is uploaded to the Image Warehouse in the `images` bucket.
## Running and using Image Factory ##
-1. Q: How do I enable Image Factory?
+1. Q: How do I enable Image Factory?
A: Run `service imagefactory start`
-2. Q: How do I run Image Factory in debug mode?
+2. Q: How do I run Image Factory in debug mode?
A: Shut the service down with `service imagefactory stop`. Then run `imagefactory
--qmf --debug` as root.
-3. Q: How do I interact with the Image Factory daemon?
+3. Q: How do I interact with the Image Factory daemon?
A: Please read through the QMF guide in the Documentation directory for some
examples.
-4. Q: How do I run the tests to know that what I have works?
+4. Q: How do I run the tests to know that what I have works?
A: The unit tests can be run from the top level of the source tree with the command
`python -m unittest discover -v`
## Troubleshooting ##
-1. Q: After starting imagefactory, the log shows "Please enter your password"
instead of "image_factory has qmf/qpid address...".
+1. Q: After starting imagefactory, the log shows "Please enter your password"
instead of "image_factory has qmf/qpid address...".
A: Put the following in /etc/qpidd.conf
-
+
cluster-mechanism=ANONYMOUS
auth=no
-2. Q: The imagefactory log shows an exception "AttributeError: 'NoneType'
object has no attribute 'makefile'"
+2. Q: The imagefactory log shows an exception "AttributeError: 'NoneType'
object has no attribute 'makefile'"
A: Please make certain the image warehouse is reachable and responds.
diff --git a/Documentation/INSTALL.markdown b/Documentation/INSTALL.markdown
index dc95b86..59198a5 100644
--- a/Documentation/INSTALL.markdown
+++ b/Documentation/INSTALL.markdown
@@ -5,17 +5,17 @@ Installing from an rpm will install all dependencies needed by Image
Factory. F
* __yum__
- The Aeolus project has built rpms available via the testing
[
repository](http://repos.fedorapeople.org/repos/aeolus/packages-testing/).
+ The Aeolus project has built rpms available via the testing
[
repository](http://repos.fedorapeople.org/repos/aeolus/packages-testing/).
After adding the appropriate `.repo` file to your `/etc/yum.repos.d` directory,
installation is as easy as running: `yum install imagefactory`
* __local rpm__
We have not yet established a download location for built packages. Until that time,
one can easily build the rpm from the source as described below.
-__Creating an rpm:__
-After obtaining a copy of Image Factory from [source
control](git://github.com/aeolusproject/image_factory.git), run: `setup.py bdist_rpm`
+__Creating an rpm:__
+After obtaining a copy of Image Factory from [source
control](git://github.com/aeolusproject/image_factory.git), run: `make rpm`
A directory named `dist` will be created to store the newly built rpm.
## via setup.py ##
-After obtaining a copy of Image Factory from [source
control](git://github.com/aeolusproject/image_factory.git), run: `setup.py install`
-Be sure to have the dependencies described in the Image Factory
[
README](https://github.com/aeolusproject/image_factory/blob/master/README...
configured.
\ No newline at end of file
+After obtaining a copy of Image Factory from [source
control](git://github.com/aeolusproject/image_factory.git), run: `setup.py install`
+Be sure to have the dependencies described in the Image Factory
[
README](https://github.com/aeolusproject/image_factory/blob/master/README...
configured.
diff --git a/Documentation/QMF.markdown b/Documentation/QMF.markdown
index cdcb303..3d8956a 100644
--- a/Documentation/QMF.markdown
+++ b/Documentation/QMF.markdown
@@ -3,7 +3,7 @@
The script imagefactory can be used to start a daemon running a QMF agent. Using the
'qpidd' option, the host that qpidd is running on can be set. Currently this
defaults to the default qpidd port on localhost. Future versions will accept an amqp://
URL to fully configure the agent session.
Example usage:
-
+
./imagefactory --verbose --qmf --qpidd localhost
Once the agent has opened a session, QMF consoles can send messages to the agent start
image builds, get status on builds, etc.
@@ -12,10 +12,10 @@ Once the agent has opened a session, QMF consoles can send messages to
the agent
## Image Factory Agent ##
-Once a console connects to the same QMF bus as the Image Factory, the agent can be found
given the vendor ("redhat.com") and product ("imagefactory") portions
of the agent name.
+Once a console connects to the same QMF bus as the Image Factory, the agent can be found
given the vendor ("redhat.com") and product ("imagefactory") portions
of the agent name.
Example 1 - Getting an agent list in python
-
+
In [1]: import cqpid
In [2]: from qmf2 import *
In [3]: connection = cqpid.Connection("localhost")
@@ -23,29 +23,29 @@ Once a console connects to the same QMF bus as the Image Factory, the
agent can
In [5]: session = ConsoleSession(connection)
In [6]: session.open()
In [7]: session.getAgents()
- Out[7]:
+ Out[7]:
[apache.org:qpidd:41fc7abd-56cc-4090-97a8-011ef1104f7f,
redhat.com:imagefactory:5edbf641-78ba-4375-8ec8-f60f555e173a]
-
+
Given an agent, an imagefactory can be fetched:
Example 2 - Querying for an imagefactory
-
+
In [14]: factory = agent.query("{class:ImageFactory,
package:'com.redhat.imagefactory'}")[0]
-
+
The imagefactory can then be sent a message to build an image:
Example 3 - Building an image
-
+
In [15]: factory.build_image("", "",
"<template></template>", ["mock"])
- Out[15]:
+ Out[15]:
{'build_adaptors': [{'_agent_epoch': 1L,
'_agent_name':
'redhat.com:imagefactory:5edbf641-78ba-4375-8ec8-f60f555e173a',
'_object_name':
'build_adaptor:db21dd5e-b3b6-49d1-a432-07f9f2d1c3c5'}]}
-
+
The console can poll the build_adaptor for build status or receive events listed below.
Example 4 - Querying for build status
-
+
In [20]: response = factory.build_image("", ""
"<template></template>", ["mock"])
In [21]: build_addr = DataAddr(response['build_adaptors'][0])
In [22]: query = Query(build_addr)
@@ -55,7 +55,7 @@ The console can poll the build_adaptor for build status or receive
events listed
Out[24]: 'FINISHING'
In [25]: agent.query(query)[0].status
Out[25]: 'COMPLETED'
-
+
---
## Schemas for Image Factory classes ##
@@ -64,7 +64,7 @@ The console can poll the build_adaptor for build status or receive
events listed
package = "com.redhat.imagefactory"
#### Methods: ####
* `build_image(image, build, template, targets)`
-
+
method name = "build_image"
desc = "Build an image for the given targets"
arguments:
@@ -86,7 +86,7 @@ The console can poll the build_adaptor for build status or receive
events listed
desc = "the QMF addresses of the build_adaptors instantiated"
* `provider_image(image, build, providers, credentials)`
-
+
method name = "push_image"
desc = "Push an image to the given providers."
arguments:
@@ -108,7 +108,7 @@ The console can poll the build_adaptor for build status or receive
events listed
desc = "the QMF addresses of the build_adaptors instantiated"
* `import_image(image, build, target_identifier, image_desc, target, provider)`
-
+
method name = "import_image"
desc = "Import an image using a target specific image identifier"
arguments:
@@ -145,7 +145,7 @@ The console can poll the build_adaptor for build status or receive
events listed
desc = "the UUID of the provider image object"
* `instance_states(class_name)`
-
+
method name = "instance_states"
desc = "Returns a dictionary representing the finite state machine for
instances."
arguments:
@@ -156,47 +156,47 @@ The console can poll the build_adaptor for build status or receive
events listed
name = "states"
dtype = SCHEMA_DATA_STRING
desc = "string representation of a dictionary describing the
workflow"
-
+
### BuildAdaptor class ###
name = "BuildAdaptor"
package = "com.redhat.imagefactory"
#### Properties: ####
* Image
-
+
name = "image"
dtype = SCHEMA_DATA_STRING
desc = "the uuid of the image being built or pushed"
* Build
-
+
name = "build"
dtype = SCHEMA_DATA_STRING
desc = "the uuid of the image build being built or pushed"
* Status
-
+
name = "status"
dtype = SCHEMA_DATA_STRING
desc = "string representing the status (see instance_states() on
ImageFactory)"
* Percentage Complete
-
+
name = "percent_complete"
dtype = SCHEMA_DATA_INT
desc = "the estimated percentage through an operation"
* Target/Provider Image ID
-
+
name = "image_id"
dtype = SCHEMA_DATA_STRING
desc = "the uuid of the newly created target or provider image"
#### Methods: ####
* `abort()`
-
+
name = "abort"
desc = "If possible, abort running build."
#### Events: ####
* Status Updates
-
+
name = "BuildAdaptorStatusEvent"
package = "com.redhat.imagefactory"
attributes:
@@ -212,9 +212,9 @@ The console can poll the build_adaptor for build status or receive
events listed
name = "old_status"
dtype = SCHEMA_DATA_STRING
desc = "string value of the old status"
-
+
* Updates to the Percentage Complete
-
+
name = "BuildAdaptorPercentCompleteEvent"
package = "com.redhat.imagefactory"
attributes:
@@ -227,9 +227,9 @@ The console can poll the build_adaptor for build status or receive
events listed
name = "percent_complete"
dtype = SCHEMA_DATA_INT
desc = "the estimated percentage through an operation"
-
+
* Failure Notification
-
+
name = "BuildFailedEvent"
package = "com.redhat.imagefactory"
attributes:
diff --git a/Documentation/man/imagefactory.1 b/Documentation/man/imagefactory.1
index 6f36a0c..ed70b14 100644
--- a/Documentation/man/imagefactory.1
+++ b/Documentation/man/imagefactory.1
@@ -23,7 +23,7 @@ Currently supported private cloud services: RHEV-M, KVM.
.SH OPTIONS
-.B -h, --help
+.B -h, --help
Display the help page.
.B --version
@@ -51,7 +51,7 @@ Set the timeout period for image building in seconds. (default: 3600)
Provide a QMFv2 agent interface.
.B --foreground
-Stay in the foreground and avoid launching a daemon.
+Stay in the foreground and avoid launching a daemon.
Launching in foreground allows the user to see what messages are being passed to QMF. For
more detailed output use this parameter together with .B --debug.
If the parameter is not specified, the QMF agent will be started as a daemon.
(default: False)
@@ -66,7 +66,7 @@ URL of qpidd to connect to. (default: localhost)
Build specified system and exit.
.B --template TEMPLATE
-Template to build from. Template can be passed as URL, PATH, UUID or XML. Please refer to
the
+Template to build from. Template can be passed as URL, PATH, UUID or XML. Please refer to
the
.BR XML
.BR EXAMPLES
section at the bottom.
@@ -83,9 +83,9 @@ The list of cloud services to target. Examples include ec2, rhevm,
vsphere, rack
The list of cloud service providers to push the emacs. Examples include ec2-us-east-1,
ec2-us-west-1, rackspace.
.B --credentials CREDENTIALS
-Cloud provider credentials. Credentials must be passed as XML file. Please refer to the
-.BR XML
-.BR EXAMPLES
+Cloud provider credentials. Credentials must be passed as XML file. Please refer to the
+.BR XML
+.BR EXAMPLES
section at the bottom.
.SS Image Warehouse:
@@ -126,7 +126,7 @@ rackspace = "<provider_credentials> \\
</rackspace_credentials> \\
</provider_credentials>"
-.SS TEMPLATE
+.SS TEMPLATE
eg. a Windows 2008 64bit example
<template>
@@ -160,7 +160,3 @@ eg. a Windows 2008 64bit example
</package>
</packages>
</template>
-
-
-
-
diff --git a/imgfac/ReservationManager.py b/imgfac/ReservationManager.py
index 56e1f80..08edc0d 100644
--- a/imgfac/ReservationManager.py
+++ b/imgfac/ReservationManager.py
@@ -100,7 +100,7 @@ class ReservationManager(object):
self.log.warn('No reservation for %s to cancel!' % filepath)
else:
raise e
- except KeyError,e:
+ except KeyError, e:
if(quiet):
self.log.warn('No reservations exist on %s!' % mount_path)
else:
@@ -148,9 +148,9 @@ class ReservationManager(object):
def available_space_for_path(self, path):
"""
TODO: Docstring for available_space_for_path
-
- @param path TODO
-
+
+ @param path TODO
+
@return TODO
"""
mount_path = self._mount_for_path(path)
diff --git a/imgfac/builders/FedoraBuilder.py b/imgfac/builders/FedoraBuilder.py
index a311bd8..9f559a8 100644
--- a/imgfac/builders/FedoraBuilder.py
+++ b/imgfac/builders/FedoraBuilder.py
@@ -1143,7 +1143,7 @@ class FedoraBuilder(BaseBuilder):
input_image_compressed_name = input_image_name + ".gz"
input_image_compressed=input_image + ".gz"
-
+
if not os.path.isfile(input_image_compressed):
self.log.debug("No compressed version of image file found - compressing
now")
f_out = open(input_image_compressed, 'wb')
@@ -1262,7 +1262,7 @@ class FedoraBuilder(BaseBuilder):
if volume.status == "available":
retcode = 0
break
- self.log.debug("Volume status (%s) - waiting for
'available': %d/600" % (volume.status, i*10))
+ self.log.debug("Volume status (%s) - waiting for
'available': %d/600" % (volume.status, i*10))
sleep(10)
if retcode:
@@ -1322,11 +1322,11 @@ class FedoraBuilder(BaseBuilder):
self.log.debug("Registering snapshot (%s) as new EBS AMI" %
(snapshot.id))
ebs = EBSBlockDeviceType()
ebs.snapshot_id = snapshot.id
- block_map = BlockDeviceMapping()
- block_map['/dev/sda1'] = ebs
- result = conn.register_image(name='ImageFactory created AMI - %s' %
(self.new_image_id),
+ block_map = BlockDeviceMapping()
+ block_map['/dev/sda1'] = ebs
+ result = conn.register_image(name='ImageFactory created AMI - %s' %
(self.new_image_id),
description='ImageFactory created AMI - %s' %
(self.new_image_id),
- architecture=self.tdlobj.arch, kernel_id=aki,
+ architecture=self.tdlobj.arch, kernel_id=aki,
root_device_name='/dev/sda1',
block_device_map=block_map)
ami_id = str(result)
@@ -1335,9 +1335,9 @@ class FedoraBuilder(BaseBuilder):
self.log.debug("Stopping EC2 instance and deleting temp security group
and volume")
instance.stop()
factory_security_group.delete()
- key_file_object.close()
+ key_file_object.close()
conn.delete_key_pair(key_name)
-
+
if volume:
self.log.debug("Waiting up to 240 seconds for instance (%s) to shut
down" % (instance.id))
retcode = 1
diff --git a/imgfac/builders/RHELBuilder.py b/imgfac/builders/RHELBuilder.py
index dabfbca..96548a9 100644
--- a/imgfac/builders/RHELBuilder.py
+++ b/imgfac/builders/RHELBuilder.py
@@ -17,18 +17,17 @@ import zope
from IBuilder import IBuilder
from BaseBuilder import BaseBuilder
-
class RHELBuilder(BaseBuilder):
- """docstring for RHELBuilder"""
- zope.interface.implements(IBuilder)
+ """docstring for RHELBuilder"""
+ zope.interface.implements(IBuilder)
# Initializer
- def __init__(self, template=None, target=None):
- super(RHELBuilder, self).__init__(template, target)
+ def __init__(self, template=None, target=None):
+ super(RHELBuilder, self).__init__(template, target)
# Image actions
- def build_image(self, build_id=None):
- pass
+ def build_image(self, build_id=None):
+ pass
- def abort(self):
- pass
+ def abort(self):
+ pass
--
1.7.4.4