<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>/dev/zero</title>
	<atom:link href="http://blog.devzero.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.devzero.com</link>
	<description>The infinite stream</description>
	<lastBuildDate>Thu, 11 Apr 2013 17:31:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='blog.devzero.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>/dev/zero</title>
		<link>http://blog.devzero.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.devzero.com/osd.xml" title="/dev/zero" />
	<atom:link rel='hub' href='http://blog.devzero.com/?pushpress=hub'/>
		<item>
		<title>What&#8217;s New in Euca2ools 3, Part 2:  A Developer&#8217;s Perspective</title>
		<link>http://blog.devzero.com/2013/04/03/whats-new-in-euca2ools-3-part-2-a-developers-perspective/</link>
		<comments>http://blog.devzero.com/2013/04/03/whats-new-in-euca2ools-3-part-2-a-developers-perspective/#comments</comments>
		<pubDate>Wed, 03 Apr 2013 13:05:45 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[eucalyptus]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[euca2ools]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=492</guid>
		<description><![CDATA[The upcoming version of euca2ools, version 3, completely reworks the command line suite to make it both easier to write and easier to use. Part 1 of this series discussed the user-facing changes version 3 has to offer, and today we&#8217;re going to take a look at how things improve on the developer&#8217;s side of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=492&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The upcoming version of euca2ools, version 3, completely reworks the command line suite to make it both easier to write and easier to use.  <a href="http://blog.devzero.com/2013/02/21/whats-new-in-euca2ools-3-part-1-a-users-perspective/" title="What’s New in Euca2ools 3, Part 1:  A User’s Perspective">Part 1</a> of this series discussed the user-facing changes version 3 has to offer, and today we&#8217;re going to take a look at how things improve on the developer&#8217;s side of the fence.</p>
<h4>A change in philosophy:  declarative programming</h4>
<p>The developer is very much in the driver&#8217;s seat in version 1 of euca2ools.  To use a car analogy, the developer directly controls the code&#8217;s direction, speed, and gearbox manually.  Version 2 adds a cruise control by centralizing a lot of boilerplate code in the form of boto&#8217;s <code>roboto</code> module.  Version 3 opts to let the developer give the <a href="https://github.com/boto/requestbuilder">requestbuilder</a> framework a destination, step aside completely, and let it do the driving for the boring parts of the trip.</p>
<p>Requestbuilder offers a set of base classes and a domain-specific language based on python&#8217;s standard <code>argparse</code> library that allows the developer to say exactly how something should look at the command line in addition to how it should look when given to the server all in the same place.</p>
<p>What makes this so powerful is that it lets anybody with a service&#8217;s documentation and knowledge of how to use <code>argparse</code> write a command line tool quickly and painlessly.  For instance, it took me around a day to write highly-customized command line tools for every operation Amazon&#8217;s Elastic Load Balancing service supports.  Here&#8217;s the code from one of them:</p>
<pre class="brush: python; title: ; notranslate">
class CreateLBCookieStickinessPolicy(ELBRequest):
    DESCRIPTION = ('Create a new stickiness policy for a load balancer, '
                   'whereby the load balancer automatically generates cookies '
                   'that it uses to route requests from each user to the same '
                   'back end instance. This type of policy can only be '
                   'associated with HTTP or HTTPS listeners.')
    ARGS = [Arg('LoadBalancerName', metavar='ELB',
                help='name of the load balancer to modify (required)'),
            Arg('-e', '--expiration-period', dest='CookieExpirationPeriod',
                metavar='SECONDS', type=int, required=True,
                help='''time period after which cookies should be considered
                stale (default: user's session length) (required)'''),
            Arg('-p', '--policy-name', dest='PolicyName', metavar='POLICY',
                required=True, help='name of the new policy (required)')]
</pre>
<p>The framework hands everything inside each <code>Arg</code> in this code to <code>argparse</code> to gather input from the command line and then send the results directly to the web server using whatever name argparse gives the input it gets.  For instance, whatever a user supplies using the <code>-e</code> option ends up getting sent to the server as a <code>CookieExpirationPeriod</code> parameter.  With a small amount of practice it becomes quite easy to write a bunch of commands this way very quickly.</p>
<h4>One request, one command</h4>
<p>Euca2ools are built around a &#8220;one request, one command&#8221; tenet.  This means that, in general, there is a dedicated command for each thing a web service can do.  This philosophy naturally lends itself to the tight coupling between command line options and what gets sent to the server discussed earlier, but it also lends itself to reversing the usual relationship between web services and web service requests.  Whereas one typically writes an object that represents the service and uses methods on it to send requests, in euca2ools it is the commands, and thus the requests, which are the first-class citizens.  Each command that represents a request instead points to a service, rather than the other way around.</p>
<p>The way this works in practice is by defining a base class for each service and a base class that all methods which use that service share:</p>
<pre class="brush: python; title: ; notranslate">
class CloudWatch(requestbuilder.service.BaseService):
    NAME = 'monitoring'
    DESCRIPTION = 'Instance monitoring service'
    API_VERSION = '2010-08-01'
    AUTH_CLASS = requestbuilder.auth.QuerySigV2Auth
    URL_ENVVAR = 'AWS_CLOUDWATCH_URL'

    ARGS = [MutuallyExclusiveArgList(
                Arg('--region', dest='userregion', metavar='USER@REGION',
                    route_to=SERVICE, help='''name of the region and/or user
                    in config files to use to connect to the service'''),
                Arg('-U', '--url', metavar='URL', route_to=SERVICE,
                    help='instance monitoring service endpoint URL'))]

class CloudWatchRequest(requestbuilder.request.AWSQueryRequest):
    SERVICE_CLASS = CloudWatch
</pre>
<p>Services can supply their own command line options in the same way as requests.  After it gathers options from the command line, requestbuilder uses <code>route_to</code> to choose where to send it.  This also provides a convenient way to tell the framework not to send an option to the server at all when a command needs to process it specially:  just use <code>route_to=None</code>.</p>
<h4>Convention over configuration</h4>
<p>The oft-quoted programming paradigm for frameworks is just as true for euca2ools 3 as it is elsewhere.  Want to make a command print something?  Just write a <code>print_result</code> method.  The result from the server gets passed in as a dictionary.</p>
<pre class="brush: python; title: ; notranslate">
class TerminateInstances(EucalyptusRequest):
    DESCRIPTION = 'Terminate one or more instances'
    ARGS = [Arg('InstanceId', metavar='INSTANCE', nargs='+',
                help='ID(s) of the instance(s) to terminate')]
    LIST_TAGS = ['instancesSet']

    def print_result(self, result):
        for instance in result.get('instancesSet', []):
            print self.tabify(('INSTANCE', instance.get('instanceId'),
                               instance.get('previousState', {}).get('name'),
                               instance.get('currentState', {}).get('name')))
</pre>
<p>Want to make a request do fancier preparations than <code>argparse</code> can do on its own?  Just write a <code>preprocess</code> method that takes things from <code>self.args</code> and adds things to <code>self.params</code> to be sent to the server.</p>
<pre class="brush: python; title: ; notranslate">
class DescribeSecurityGroups(EucalyptusRequest):
    DESCRIPTION = ('Show information about security groups\n\nNote that '
                   'filters are matched on literal strings only, so '
                   '&quot;--filter ip-permission.from-port=22&quot; will *not* match a '
                   'group with a port range of 20 to 30.')
    ARGS = [Arg('group', metavar='GROUP', nargs='*', route_to=None,
                default=[], help='limit results to specific security groups')]
    ...
    def preprocess(self):
        for group in self.args['group']:
            if group.startswith('sg-'):
                self.params.setdefault('GroupId', [])
                self.params['GroupId'].append(group)
            else:
                self.params.setdefault('GroupName', [])
                self.params['GroupName'].append(group)
</pre>
<p>There are also a few other methods one can plug in, such as <code>postprocess</code>, and, for especially early-running code, <code>configure</code>.  Expect documentation for requestbuilder that covers this in detail in the future.</p>
<h4>Scratching the surface</h4>
<p>The examples above cover only a fraction of what is possible with euca2ools 3&#8242;s new infrastructure.  While you can look forward to some more advanced uses of it in later blog posts, you can also take a look at the current euca2ools code in development to see some of the interesting things one can do with it.  Today&#8217;s pre-release of that code carries with it commands for all three of AWS&#8217;s &#8220;triangle&#8221; services:  Auto Scaling, CloudWatch, and Elastic Load Balancing.  Continuing what seems to have become a euca2ools tradition, just look for the commands that start with <code>euscale</code> (pronounced &#8220;you scale&#8221;) <code>euwatch</code> (&#8220;you watch&#8221;), and <code>eulb</code> (&#8220;you&#8217;ll be&#8221;).</p>
<p>Packages for Fedora and RHEL 6 are available <a href="http://repos.fedorapeople.org/repos/gholms/cloud/">here</a>.  If you&#8217;re using another OS or want to build the code yourself you can simply clone euca2ools&#8217;s <a href="https://github.com/eucalyptus/euca2ools">git repository</a>&#8216;s <code>requestbuilder</code> branch.  Requestbuilder itself is available on <a href="https://pypi.python.org/pypi/requestbuilder">PyPI</a> and <a href="https://github.com/boto/requestbuilder">GitHub</a>.  As always, I encourage you to test this code against AWS and Eucalyptus 3.3 and let me know what you think on the <a href="https://groups.google.com/a/eucalyptus.com/forum/#!forum/euca-users">euca-users</a> mailing list.  If you encounter bugs, please file them in the project&#8217;s <a href="https://eucalyptus.atlassian.net/browse/TOOLS">bug tracker</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/492/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/492/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=492&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2013/04/03/whats-new-in-euca2ools-3-part-2-a-developers-perspective/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
		<item>
		<title>What&#8217;s New in Euca2ools 3, Part 1:  A User&#8217;s Perspective</title>
		<link>http://blog.devzero.com/2013/02/21/whats-new-in-euca2ools-3-part-1-a-users-perspective/</link>
		<comments>http://blog.devzero.com/2013/02/21/whats-new-in-euca2ools-3-part-1-a-users-perspective/#comments</comments>
		<pubDate>Thu, 21 Feb 2013 21:00:30 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[eucalyptus]]></category>
		<category><![CDATA[aws]]></category>
		<category><![CDATA[euca2ools]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=444</guid>
		<description><![CDATA[Version 3 of euca2ools, slated for release in just a couple months, gives the command line suite a much-needed refresh that makes it both easier to write and easier to use. Most of the innovation here involves changes to the platform upon which it is built. I will cover those changes from a developer&#8217;s perspective [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=444&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Version 3 of <a href="https://github.com/eucalyptus/euca2ools/tree/requestbuilder">euca2ools</a>, slated for release in just a couple months, gives the command line suite a much-needed refresh that makes it both easier to write and easier to use.  Most of the innovation here involves <a href="http://blog.devzero.com/2012/04/14/euca2ools-past-present-and-future/" title="Euca2ools: Past, Present, and Future">changes</a> to the platform upon which it is built.  I will cover those changes from a developer&#8217;s perspective in future blog posts, but today I&#8217;m going to focus on what euca2ools 3 brings to the table for developers and other users alike.  While there are too many small improvements to possibly cover them all, euca2ools 3 at last brings a few of the niceties power users have come to expect from their command line tools to cloud management.</p>
<h4>A configuration file</h4>
<p>Yes, you read that right:  a configuration file.  Both euca2ools and the command line tools provided by AWS themselves have astonishingly limited support for configuration, forcing people to resort to writing a separate shell script for each combination of users and clouds one might possibly want to access and then use them in place of one.</p>
<p>Your cries of anguish have been heard, so now we have this:</p>
<pre class="brush: plain; auto-links: false; light: true; title: ; notranslate">
[user gholms]
key-id = AKIA93F29V0AEXAMPLE
secret-key = vcasd93cm1458un4vj84039vda78mDEXAMPLE

[user ecc-admin]
key-id = EVDB93F29V0AEXAMPLE
secret-key = 38fva93cm1458un4vj84039vda78mDEXAMPLE

[region us-east-1]
ec2-url = https://ec2.amazonaws.com/
iam-url = https://iam.amazonaws.com/
s3-url  = https://s3.amazonaws.com/
user = gholms

[region ecc]
ec2-url = https://communitycloud.eucalyptus.com:8773/services/Eucalyptus/
iam-url = https://communitycloud.eucalyptus.com:8773/services/Euare/
s3-url  = https://communitycloud.eucalyptus.com:8773/services/Walrus/
user = ecc-admin

[global]
default-region = us-east-1
</pre>
<p>A file like this, combined with the <code>--region</code> option that all tools share, mean you can mix and match users and clouds to you heart&#8217;s content.  Just throw a file like this inside of <code>~/.euca</code>, end it with <code>.ini</code>, and away you go!  You can add as many files to <code>~/.euca</code> as you want —  they all get combined together.</p>
<h4>Friendly error feedback</h4>
<p>Another common complaint that people had with euca2ools 2 was its behavior in the face of input that didn&#8217;t match what it expected.  Some of the worst offenders had error messages ranging from <a href="https://eucalyptus.atlassian.net/browse/TOOLS-38">confusing</a> to <a href="https://eucalyptus.atlassian.net/browse/TOOLS-150">irrelevant</a> to <a href="https://eucalyptus.atlassian.net/browse/TOOLS-83">nonexistent</a>.  Euca2ools 3 overhauls the code that does this, replacing it with standard python tools and friendlier code that makes its behavior in the face of errors much better.</p>
<p>Here&#8217;s how it behaves in the face of the most common case of this:</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% euca-describe-availability-zones
error: missing access key ID; please supply one with -I
</pre>
<p>Also included is special treatment for &#8220;pick one from multiple alternatives&#8221; options:</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% euare-useraddcert
usage: euare-useraddcert (-c CERT | -f FILE) [-u USER]
                         [--as-account ACCOUNT] [--region REGION | -U URL]
                         [-I KEY_ID] [-S KEY]
euare-useraddcert: error: one of the arguments -c/--certificate-body -f/--certificate file is required
</pre>
<p>A lot of attention to detail went into dealing with some of the most common mistakes people make:</p>
<pre class="brush: plain; highlight: [1,3]; light: true; title: ; notranslate">
% euca-register -n myimage -b /dev/sda1=snap-12345678:false
euca-register: error: argument -b/--block-device-mapping: second element of EBS block device mapping &quot;/dev/sda1=snap-00000000:false&quot; must be an integer
% euca-authorize mygroup -p 8773:8777
euca-authorize: error: argument -p/--port-range: multi-port range must be separated by &quot;-&quot;, not &quot;:&quot;
</pre>
<h4>Tagging and filtering support</h4>
<p>Euca2ools 3 at last offers full support for EC2&#8242;s massive sets of resource tags and filters:</p>
<pre class="brush: plain; collapse: true; gutter: false; highlight: [1]; light: false; title: ; toolbar: true; notranslate">
% euca-describe-instances -h
usage: euca-describe-instances [-h] [--show-empty-fields]
...
  --filter NAME=VALUE   restrict results to those that meet criteria
...

allowed filter names:
  architecture          CPU architecture
  availability-zone
  block-device-mapping.attach-time
                        volume attachment time
  block-device-mapping.delete-on-termination
                        whether a volume is deleted upon instance
                        termination
  block-device-mapping.device-name
                        volume device name (e.g.  /dev/sdf)
  block-device-mapping.status
                        volume status
  block-device-mapping.volume-id
                        volume ID
  client-token          idempotency token provided at instance run
                        time
  dns-name              public DNS name
  group-id              security group membership
  hypervisor            hypervisor type
  image-id              machine image ID
  instance-id
  instance-lifecycle    whether this is a spot instance
  instance-state-code   numeric code identifying instance state
  instance-state-name   instance state
  instance-type
  ip-address            public IP address
  kernel-id             kernel image ID
  key-name              key pair name provided at instance launch time
  launch-index          launch index within a reservation
  launch-time           instance launch time
  monitoring-state      whether monitoring is enabled
  owner-id              instance owner's account ID
  placement-group-name
  platform              whether this is a Windows instance
  private-dns-name
  private-ip-address
  product-code
  ramdisk-id            ramdisk image ID
  reason                reason for the more recent state change
  requestor-id          ID of the entity that launched an instance
  reservation-id
  root-device-name      root device name (e.g.  /dev/sda1)
  root-device-type      root device type (ebs or instance-store)
  spot-instance-request-id
  state-reason-code     reason code for the most recent state change
  state-reason-message  
                        message for the most recent state change
  subnet-id             ID of the VPC subnet the instance is in
  tag-key               name of any tag assigned to the instance
  tag-value             value of any tag assigned to the instance
  tag:KEY               specific tag key/value combination
  virtualization-type
  vpc-id                ID of the VPC the instance is in
</pre>
<p>The new foundation this code is based upon makes it incredibly simple to extend support for these features as things change in the future.</p>
<h4>What else?</h4>
<p>Some other minor, but nonetheless noteworthy, changes include:</p>
<ul>
<li><code>euca-*</code> tools gained a <code>--show-empty-fields</code> option that tweaks their output to make it friendlier for running through the <code>column</code> command.</li>
<li>All tools that access web services use the same options (<code>-I</code> and <code>-S</code>) for access keys.</li>
<li><code>euare-*</code> tools&#8217; <code>--delegate</code> option for cloud administrators is now <code>--as-account</code>.</li>
<li>Multiple <code>--filter</code> options are handled correctly.</li>
<li>Machine image device mappings are now handled correctly.</li>
</ul>
<p>A few tools have yet to be ported to the new framework, but will be in the near future.  <code>eustore-installimage</code> is known to be broken.  The bundle management tools should work correctly, though their testing to date has been minimal.  Finally, do not install them on a system that runs a Eucalyptus node controller.</p>
<h4>Isn&#8217;t aws-cli the future?  Why continue developing euca2ools?</h4>
<p><a href="https://github.com/aws/aws-cli">Aws-cli</a> is a great project.  Both it and euca2ools tie what the server sees very closely to what the user sees under the hood, but the euca2ools suite does so in a way that makes it trivial to customize tools to do more complicated things behind the hood or to make them easier to use.  For instance, consider changing a security group&#8217;s permissions in EC2 with aws-cli:</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% aws ec2 authorize-security-group-ingress --group-name MySecurityGroup --ip-permissions '{&quot;from_port&quot;:22,&quot;to_port&quot;:22,&quot;ip_protocol&quot;:&quot;tcp&quot;,&quot;ip_ranges&quot;:[&quot;0.0.0.0/0&quot;]}'
</pre>
<p>The exact format we need to use to supply the info the tool needs requires relatively detailed knowledge of what EC2-the-server expects.  Compared to that, the euca2ools version of that is easier to remember and much easier to type:</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% euca-authorize MySecurityGroup --port 22 --source-subnet 0.0.0.0/0
</pre>
<p>Aws-cli is a very young project, so people haven&#8217;t yet had the chance to iron it out completely.  Perhaps some day it will become as user-friendly as euca2ools and finally eclipse it.  But we aren&#8217;t there yet.</p>
<h4>How can I try it out?</h4>
<p>If you&#8217;re interested in a preview of the next major version of euca2ools, an alpha release is <a href="https://github.com/eucalyptus/euca2ools/tree/requestbuilder">available on GitHub</a>.  In addition to the dependencies required to run euca2ools 2, you will also need to install <a href="https://pypi.python.org/pypi/requests">requests</a> and the new <a href="https://pypi.python.org/pypi/requestbuilder">requestbuilder</a> framework that drives the new tools.  It is still alpha-quality software, so be prepared to find bugs.  If you encounter any, feel free to file them in the euca2ools project&#8217;s <a href="https://eucalyptus.atlassian.net/browse/TOOLS">bug tracker</a>.</p>
<p>If you&#8217;re interested in helping with development, we are happy to accept pull requests on GitHub.  Please also consider joining the <a href="https://groups.google.com/a/eucalyptus.com/forum/#!forum/euca-users">euca-users mailing list</a> or stopping by in the <code>#eucalyptus-devel</code> IRC channel on Freenode.  I look forward to hearing your feedback.  8^)</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/444/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=444&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2013/02/21/whats-new-in-euca2ools-3-part-1-a-users-perspective/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
		<item>
		<title>How to Override a Class Method in Python</title>
		<link>http://blog.devzero.com/2013/01/28/how-to-override-a-class-method-in-python/</link>
		<comments>http://blog.devzero.com/2013/01/28/how-to-override-a-class-method-in-python/#comments</comments>
		<pubDate>Mon, 28 Jan 2013 08:00:22 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=406</guid>
		<description><![CDATA[A class method in python differs from an instance method in a couple important ways: It binds to a class rather than an instance (hence its name). Thus, its first argument is a class, often called cls rather than the usual self. It can be called on both an instance of a class and the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=406&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>A class method in python differs from an instance method in a couple important ways:</p>
<ol>
<li>It binds to a class rather than an instance (hence its name).  Thus, its first argument is a class, often called <code>cls</code> rather than the usual <code>self</code>.</li>
<li>It can be called on both an instance of a class and the class itself.</li>
</ol>
<p>In general, they behave similarly, but one area in which they can differ is when we go to override the class method:</p>
<pre class="brush: python; title: ; notranslate">
class Spam(object):
    @classmethod
    def parrot(cls, message):
        print cls.__name__, &quot;says:&quot;, message

class Eggs(Spam):
    @classmethod
    def parrot(cls, message):
        Spam.parrot(cls, message)
</pre>
<p>This code is broken because <code>Spam.parrot</code> is already bound to the <code>Spam</code> class.  This means <code>Spam.parrot</code>&#8216;s <code>cls</code> argument will be the <code>Spam</code> class rather than the <code>Eggs</code> class that we wanted, so <code>Spam.parrot</code> will end up being called in the wrong context.  Even worse, everything <code>Eggs.parrot</code> passed to it, <em>including <code>cls</code></em>, ends up getting passed as regular arguments, resulting in disaster.</p>
<pre class="brush: plain; highlight: [1,3]; light: true; title: ; notranslate">
&gt;&gt;&gt;&gt; Spam.parrot(&quot;Hello, world!&quot;)
Spam says: Hello, world!
&gt;&gt;&gt;&gt; Eggs.parrot(&quot;Hello, world!&quot;)
Traceback (most recent call last):
  File &quot;&lt;console&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;&lt;console&gt;&quot;, line 4, in parrot
TypeError: parrot() takes exactly 2 arguments (3 given)</pre>
<p>To chain up to the <code>Spam</code> class&#8217;s implementation we need to use a <code>super</code> object, which will delegate things the way we want.</p>
<pre class="brush: python; first-line: 6; title: ; notranslate">
class Eggs(Spam):
    @classmethod
    def parrot(cls, message):
        super(Eggs, cls).parrot(message)
</pre>
<p>There&#8217;s a shortcut for the last line if you&#8217;re using python 3:</p>
<pre class="brush: python; first-line: 9; title: ; notranslate">
&#xa0;       super().parrot(message)
</pre>
<p>The <code>super</code> object functions as a proxy that delegates method calls to a class higher up in the <code>Eggs</code> class&#8217;s hierarchy, and in this case it is critical in ensuring that it gets called in the right context.</p>
<pre class="brush: plain; highlight: [1,3]; light: true; title: ; notranslate">
&gt;&gt;&gt;&gt; Spam.parrot(&quot;Hello, world!&quot;)
Spam says: Hello, world!
&gt;&gt;&gt;&gt; Eggs.parrot(&quot;Hello, world!&quot;)
Eggs says: Hello, world!
</pre>
<p>If you haven&#8217;t used <code>super()</code> before, here&#8217;s what it&#8217;s doing:</p>
<ol>
<li>The python interpreter looks for <code>Eggs</code> in <code>cls.__mro__</code>, a list that represents the order in which the interpreter tries to match method and attribute names to classes.</li>
<li>The interpreter checks the class dictionary for the next class that follows <code>Eggs</code> in that list that contains <code>"parrot"</code>.</li>
<li>The <code>super</code> object returns that version of <code>"parrot"</code>, bound to <code>cls</code>, using the attribute-fetching <code>__get__(cls)</code> method.</li>
<li>When <code>Eggs.parrot</code> calls this bound method, <code>cls</code> gets passed to <code>Spam.parrot</code> in place of the <code>Spam</code> class.</li>
</ol>
<p>In general I tend to stick with the older-style syntax for chaining method calls, but this is one case where <code>super()</code> is simply indispensable.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/406/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/406/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=406&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2013/01/28/how-to-override-a-class-method-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
		<item>
		<title>Importing Key Pairs in Eucalyptus</title>
		<link>http://blog.devzero.com/2012/10/15/importing-key-pairs-in-eucalyptus/</link>
		<comments>http://blog.devzero.com/2012/10/15/importing-key-pairs-in-eucalyptus/#comments</comments>
		<pubDate>Mon, 15 Oct 2012 19:39:48 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[eucalyptus]]></category>
		<category><![CDATA[features]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=395</guid>
		<description><![CDATA[One of Eucalyptus&#8217;s oldest feature requests that people constantly ask about is the ability to import a pre-existing SSH key for use with instances. It even predates EC2&#8242;s support for doing that. I am happy to report that Eucalyptus 3.2 will at long last support it as well! (See the change on GitHub.) If you&#8217;re [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=395&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>One of Eucalyptus&#8217;s oldest feature requests that people constantly ask about is the ability to import a pre-existing SSH key for use with instances.  It even predates <a href="http://docs.amazonwebservices.com/AWSEC2/latest/APIReference/ApiReference-query-ImportKeyPair.html">EC2&#8242;s support</a> for doing that.  I am happy to report that Eucalyptus 3.2 will at long last support it as well!  (See the <a href="https://github.com/eucalyptus/eucalyptus/commit/415c150fb7b766acd2a25c4da101f0b6c83c078e">change on GitHub</a>.)  If you&#8217;re following Eucalyptus development, you can try this out right away with <code>euca-import-keypair</code>.  Chances are, your version of euca2ools already contains it.</p>
<p>The thing that makes this feature <em>really</em> nice, however, looks like this:</p>
<p><img src="http://gholms.files.wordpress.com/2012/10/import-keypair.png?w=610&#038;h=373" alt="Web UI for ImportKeypair" title="import-keypair" width="610" height="373" class="alignnone size-full wp-image-396" /></p>
<p>Just a few hours ago, the new <a href="https://github.com/eucalyptus/eucalyptus-ui">web console</a> that is slated to land alongside Eucalyptus 3.2 later this year gained support for importing key pairs as well.  (See the <a href="https://github.com/eucalyptus/eucalyptus-ui/commit/5143c76489b19e0619a54d0fa23fa1f8a82c91b8">change on GitHub</a>.)  I&#8217;m sure I am not alone in wanting to thank the contributors who added this.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/395/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=395&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2012/10/15/importing-key-pairs-in-eucalyptus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>

		<media:content url="http://gholms.files.wordpress.com/2012/10/import-keypair.png" medium="image">
			<media:title type="html">import-keypair</media:title>
		</media:content>
	</item>
		<item>
		<title>Readable Monospace Fonts</title>
		<link>http://blog.devzero.com/2012/07/24/readable-monospace-fonts/</link>
		<comments>http://blog.devzero.com/2012/07/24/readable-monospace-fonts/#comments</comments>
		<pubDate>Tue, 24 Jul 2012 07:01:07 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=300</guid>
		<description><![CDATA[The default monospace fonts on the operating systems I use range from &#8220;fairly good&#8221; on Mac OS X to &#8220;awful&#8221; on Windows. This led me to search for alternatives in the hopes that I would find something that is less of a strain on my eyes while I write code. I found a surprising number [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=300&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>The default monospace fonts on the operating systems I use range from &#8220;fairly good&#8221; on Mac OS X to &#8220;awful&#8221; on Windows.  This led me to search for alternatives in the hopes that I would find something that is less of a strain on my eyes while I write code.  I found a surprising number of good typefaces out there, many of which are even free.  I eventually settled on two, depending on what platform I am using.</p>
<p><span id="more-300"></span></p>
<h3>Inconsolata</h3>
<p><a href="http://www.levien.com/type/myfonts/inconsolata.html">Inconsolata</a> is my favorite monospaced font.  On top of that, it&#8217;s <em>free</em>.  It has its own unique sort of style that is easy on the eyes and yet instantly recognizable.  It also scales beautifully to sizes both large and small.  I use it on everything from terminal windows to code editors to the huge LCD on the wall at work.</p>
<p>Its main downside is that it doesn&#8217;t seem to look particularly great on Windows.  It looks amazing everywhere else as long as you remember to turn anti-aliasing on.  But even at sizes that are too tiny to use anti-aliasing, it still manages to remain legible.</p>
<p><a href="http://gholms.files.wordpress.com/2012/07/inconsolata-bigscreen.jpg"><img src="http://gholms.files.wordpress.com/2012/07/inconsolata-bigscreen.jpg?w=610&#038;h=457" alt="" title="Big LCD TV with 32 pt Inconsolata" width="610" height="457" class="alignnone size-full wp-image-362" /></a></p>
<p><a href="http://gholms.files.wordpress.com/2012/07/inconsolata-terminalapp.png"><img src="http://gholms.files.wordpress.com/2012/07/inconsolata-terminalapp.png?w=610" alt="" title="Terminal.app with 12 pt Inconsolata"   class="alignnone size-full wp-image-318" /></a></p>
<p><a href="http://gholms.files.wordpress.com/2012/07/inconsolata-gnome-terminal.png"><img src="http://gholms.files.wordpress.com/2012/07/inconsolata-gnome-terminal.png?w=610" alt="" title="gnome-terminal with 10 pt Inconsolata"   class="alignnone size-full wp-image-352" /></a></p>
<p>If you use Fedora you can even install Inconsolata using yum.</p>
<pre class="brush: plain; light: true; title: ; notranslate">
yum install levien-inconsolata-fonts
</pre>
<h3>Consolas</h3>
<p>On Windows I use <a href="http://www.fonts.com/font/microsoft-corporation/consolas">Consolas</a>, a commercial typeface that Microsoft bundles with Windows and Office.  It has a sort of roundish appeal to it but still manages to keep just enough of the boxy look that works well for code.  It looks cleaner than the Courier New typeface that Windows programs tend to use by default because it drops a lot of serifs that just take up space.  Unsurprisingly, it also blows the ancient, raster-based one that the command prompt uses out of the water.  Just don&#8217;t forget to leave anti-aliasing on.</p>
<p><a href="http://gholms.files.wordpress.com/2012/07/consolas-notepadpp.png"><img src="http://gholms.files.wordpress.com/2012/07/consolas-notepadpp.png?w=610" alt="" title="Notepad++ with 10 pt Consolas"   class="alignnone size-full wp-image-305" /></a></p>
<p><a href="http://gholms.files.wordpress.com/2012/07/consolas-powershell.png"><img src="http://gholms.files.wordpress.com/2012/07/consolas-powershell.png?w=610" alt="" title="PowerShell with 14 pt Consolas"   class="alignnone size-full wp-image-303" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/300/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/300/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=300&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2012/07/24/readable-monospace-fonts/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>

		<media:content url="http://gholms.files.wordpress.com/2012/07/inconsolata-bigscreen.jpg" medium="image">
			<media:title type="html">Big LCD TV with 32 pt Inconsolata</media:title>
		</media:content>

		<media:content url="http://gholms.files.wordpress.com/2012/07/inconsolata-terminalapp.png" medium="image">
			<media:title type="html">Terminal.app with 12 pt Inconsolata</media:title>
		</media:content>

		<media:content url="http://gholms.files.wordpress.com/2012/07/inconsolata-gnome-terminal.png" medium="image">
			<media:title type="html">gnome-terminal with 10 pt Inconsolata</media:title>
		</media:content>

		<media:content url="http://gholms.files.wordpress.com/2012/07/consolas-notepadpp.png" medium="image">
			<media:title type="html">Notepad++ with 10 pt Consolas</media:title>
		</media:content>

		<media:content url="http://gholms.files.wordpress.com/2012/07/consolas-powershell.png" medium="image">
			<media:title type="html">PowerShell with 14 pt Consolas</media:title>
		</media:content>
	</item>
		<item>
		<title>Better Visual Searching in Vim</title>
		<link>http://blog.devzero.com/2012/07/12/better-visual-searching-in-vim/</link>
		<comments>http://blog.devzero.com/2012/07/12/better-visual-searching-in-vim/#comments</comments>
		<pubDate>Fri, 13 Jul 2012 02:43:11 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=286</guid>
		<description><![CDATA[If you press * in the Vim editor it will search for the next place where the word the cursor is over appears. The # key does the same thing, but searches backwards instead. Unfortunately, this only works for one word at a time. But if you add some code to ~/.vimrc then you can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=286&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>If you press <code>*</code> in the Vim editor it will search for the next place where the word the cursor is over appears.  The <code>#</code> key does the same thing, but searches backwards instead.  Unfortunately, this only works for one word at a time.  But if you add some code to <code>~/.vimrc</code> then you can extend those functions to work with whatever you have selected when you are in visual mode.</p>
<pre class="brush: plain; title: ; notranslate">
&quot; Search for selected text, forwards or backwards
vnoremap &lt;silent&gt; * :&lt;C-U&gt;
  \let old_reg=getreg('&quot;')&lt;Bar&gt;let old_regtype=getregtype('&quot;')&lt;CR&gt;
  \gvy/&lt;C-R&gt;&lt;C-R&gt;=substitute(
  \escape(@&quot;, '/\.*$^~['), '\_s\+', '\\_s\\+', 'g')&lt;CR&gt;&lt;CR&gt;
  \gV:call setreg('&quot;', old_reg, old_regtype)&lt;CR&gt;
vnoremap &lt;silent&gt; # :&lt;C-U&gt;
  \let old_reg=getreg('&quot;')&lt;Bar&gt;let old_regtype=getregtype('&quot;')&lt;CR&gt;
  \gvy?&lt;C-R&gt;&lt;C-R&gt;=substitute(
  \escape(@&quot;, '?\.*$^~['), '\_s\+', '\\_s\\+', 'g')&lt;CR&gt;&lt;CR&gt;
  \gV:call setreg('&quot;', old_reg, old_regtype)&lt;CR&gt;
</pre>
<p>After adding this, select some text in visual mode (press <code>v</code> and move the cursor around) and search for what you have selected with <code>*</code> or <code>#</code>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=286&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2012/07/12/better-visual-searching-in-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
		<item>
		<title>Reverting a Range of Git Commits Separately</title>
		<link>http://blog.devzero.com/2012/07/03/reverting-a-range-of-git-commits-separately/</link>
		<comments>http://blog.devzero.com/2012/07/03/reverting-a-range-of-git-commits-separately/#comments</comments>
		<pubDate>Wed, 04 Jul 2012 01:31:37 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=278</guid>
		<description><![CDATA[All kinds of articles on the Internet tell you how to revert a range of git commits in one massive, squashed-together revert commit. But to split them up into separate revert commits you have to pass a list of commits to git revert, and that list has to go in reverse order to avoid conflicts.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=278&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>All kinds of articles on the Internet tell you how to revert a range of git commits in one massive, squashed-together revert commit.  But to split them up into separate revert commits you have to pass a list of commits to <code>git revert</code>, and that list has to go in reverse order to avoid conflicts.</p>
<pre class="brush: plain; light: true; title: ; notranslate">
git rev-list --reverse ${last_good_commit}.. | xargs git revert
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=278&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2012/07/03/reverting-a-range-of-git-commits-separately/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
		<item>
		<title>Less Obvious Changes in Eucalyptus 3.1</title>
		<link>http://blog.devzero.com/2012/06/27/less-obvious-changes-in-eucalyptus-3-1/</link>
		<comments>http://blog.devzero.com/2012/06/27/less-obvious-changes-in-eucalyptus-3-1/#comments</comments>
		<pubDate>Wed, 27 Jun 2012 19:11:21 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[eucalyptus]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=226</guid>
		<description><![CDATA[Now that Eucalyptus 3.1 is out at last and we all get to wade through tons of announcements and blog posts, I thought I would mention a few of the changes that have happened since Eucalyptus 2 that you aren&#8217;t likely to see in marketing materials. Why Eucalyptus 2? Most of us don&#8217;t get to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=226&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Now that Eucalyptus 3.1 is <a href="http://gregdekspeaks.wordpress.com/2012/06/27/today-is-the-day/">out at last</a> and we all get to wade through tons of announcements and blog posts, I thought I would mention a few of the changes that have happened since Eucalyptus 2 that you aren&#8217;t likely to see in marketing materials.</p>
<p>Why Eucalyptus 2?  Most of us don&#8217;t get to use Eucalyptus 3.0, so comparing against that wouldn&#8217;t exactly be fair, would it?  ;-)</p>
<h4>Centralized documentation</h4>
<p>The documentation for Eucalyptus 2 was strewn about the Eucalyptus website on a number of wiki pages.  You had to read <em>all</em> of them to have any hope of ending up with a working cloud.</p>
<p>Eucalyptus 3&#8242;s documentation comes in the form of <a href="http://www.eucalyptus.com/eucalyptus-cloud/documentation">front-to-back PDFs</a>.  HTML documentation is forthcoming.  You still need to read it all, but it is now in one place so you don&#8217;t have to go digging to find it.</p>
<p>The documentation&#8217;s source (in DITA format, if you find that sort of thing interesting) is also up <a href="https://github.com/eucalyptus/documentation">on github</a>, so there is now a way to fix errors:  just send a pull request.</p>
<h4>A new database</h4>
<p>Eucalyptus 3.1 switches from HSQLDB to PostgreSQL.  Given the number of Eucalyptus users I have seen over time who have experienced problems with HSQLDB&#8217;s behavior in the face of faults, I suspect this will make a lot of people happy.</p>
<h4>Correct packaging</h4>
<p>The RPM and DEB packages for Eucalyptus 2 fail to list a number of important things they depend upon, making the software needlessly complicated to install.  In fact, this was so complicated that the popular <a href="http://downloads.eucalyptus.com/software/faststart/">FastStart</a> distribution became the method of choice for getting started with a new Eucalyptus cloud.</p>
<p>This is no longer the case.  Installation now consists of adding package repositories and telling one&#8217;s package manager to install a component.  No more &#8220;install these dependencies first.&#8221;  No more &#8220;download these packages separately and install them.&#8221;  In fact, short of a script that writes Eucalyptus&#8217;s configuration for you, this completely obviates the need for FastStart.</p>
<h4>RHEL 6 support</h4>
<p>Eucalyptus 2 is supported only on CentOS 5.  It also works on RHEL 5, but users of RHEL 6 and friends couldn&#8217;t even compile the stuff.  That is now fixed; those operating systems now have full support.</p>
<h4>A more usable configuration file</h4>
<p>Eucalyptus 2&#8242;s configuration file jams everything into one huge list.  Nothing gives any indication what Eucalyptus components actually care about each option.  There is also no indication how options were affected by one&#8217;s choice of networking mode.</p>
<p>Eucalyptus 3&#8242;s configuration file and documentation break options down by component.  For networking-related options, they also list the networking modes in which they apply.</p>
<h4>Bugfixes</h4>
<p>Eucalyptus 3 fixes bugs.  Lots and lots of bugs.  So many bugs that release notes cannot possibly list them all.  In the future this will be easier, as every future bug report will now go through <a href="https://eucalyptus.atlassian.net/browse/EUCA">a new JIRA tracker</a>.</p>
<h4>What else?</h4>
<p>Those are some of my favorites, but there are lots of other little improvements all over the place.  <a href="http://www.eucalyptus.com/eucalyptus-cloud/get">Try Eucalyptus 3 out</a> and see what you think.  You may be pleasantly surprised.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/226/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/226/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=226&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2012/06/27/less-obvious-changes-in-eucalyptus-3-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
		<item>
		<title>Speed Up Merges with Git&#8217;s Index</title>
		<link>http://blog.devzero.com/2012/06/14/speed-up-merges-with-gits-index/</link>
		<comments>http://blog.devzero.com/2012/06/14/speed-up-merges-with-gits-index/#comments</comments>
		<pubDate>Thu, 14 Jun 2012 23:32:15 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=205</guid>
		<description><![CDATA[We&#8217;ve all been there, running git merge only to have it spew CONFLICT all over the place and quit partway through. But if we already know that every time there is a conflict then all of &#8220;our&#8221; code that we are merging changes into should take precedence over &#8220;their&#8221; changes that we are pulling in, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=205&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>We&#8217;ve all been there, running <code>git merge</code> only to have it spew <code>CONFLICT</code> all over the place and quit partway through.  But if we already know that every time there is a conflict then all of &#8220;our&#8221; code that we are merging changes into should take precedence over &#8220;their&#8221; changes that we are pulling in, git 1.7.3 provides a handy shortcut for that:</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% git merge -X ours theirbranch
</pre>
<p>If &#8220;their&#8221; changes that we are pulling in should always take precedence instead then things are equally easy:</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% git merge -X theirs theirbranch
</pre>
<p>If &#8220;ours&#8221; or &#8220;theirs&#8221; style merges will work, but only for certain files, things get a bit more complicated.  But with a bit of background knowledge of how git&#8217;s index works we can save ourselves a bunch of work.</p>
<p>The index stores what <em>stage</em> a file is in.  Normally, a file&#8217;s stage is 0.</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% git ls-files -s myfile
100644 4b48deed3a433909bfd6b6ab3d4b91348b6af464 0       myfile
</pre>
<p>A file with a merge conflict is different because the index actually has <a href="https://en.wikipedia.org/wiki/Merge_%28revision_control%29#Three-way_merge">three different versions</a> of it:  the version that the two branches we are merging most recently had in common, the version on &#8220;our&#8221; side of the merge, and the version on &#8220;their&#8221; side of the merge.  In git these correspond to stages 1, 2, and 3.  This is one reason one has to run <code>git add</code> on every conflicting file before completing a merge.</p>
<pre class="brush: plain; highlight: [1]; light: true; title: ; notranslate">
% git ls-files -s myfile
100644 4b48deed3a433909bfd6b6ab3d4b91348b6af464 1       myfile
100644 5be4a414b32cf4204f889469942986d3d783da84 2       myfile
100644 39c5733494077ae8bc45c45c15a708ffe9871966 3       myfile
</pre>
<p>Rather than opening up the conflicting file and clearing out the parts that clash by hand, we can instead simply copy the version we want from the index into our working tree:</p>
<pre class="brush: plain; highlight: [1,2,3]; light: true; title: ; notranslate">
% git checkout-index -f --stage 3 myfile
% git add myfile
% git commit
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/205/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/205/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=205&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2012/06/14/speed-up-merges-with-gits-index/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
		<item>
		<title>Git Pull via Sneakernet</title>
		<link>http://blog.devzero.com/2012/06/08/git-pull-via-sneakernet/</link>
		<comments>http://blog.devzero.com/2012/06/08/git-pull-via-sneakernet/#comments</comments>
		<pubDate>Fri, 08 Jun 2012 23:01:35 +0000</pubDate>
		<dc:creator>gholms</dc:creator>
				<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://blog.devzero.com/?p=194</guid>
		<description><![CDATA[Today I found myself needing to move some commits between two repositories. In general the best way to do this is by pulling changes from one into the other, but in this case the repositories did not have direct access to each other. Rather than copying an entire repository from one machine to another or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=194&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Today I found myself needing to move some commits between two repositories.  In general the best way to do this is by pulling changes from one into the other, but in this case the repositories did not have direct access to each other.  Rather than copying an entire repository from one machine to another or mucking about with a pile of patches, we can save time by performing the sending and receiving sides of the network-enabled <code>git fetch</code> command by hand.</p>
<p>In the source repository, add the changes we want to move to a <em>bundle</em> that we can copy to a USB stick:</p>
<pre class="brush: plain; highlight: [1,7]; light: true; title: ; notranslate">
% git bundle create changes.bundle master..mybranch
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 313 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
% cp changes.bundle /media/usbstick
</pre>
<p>In the destination repository, ensure that we have the commits necessary to use the bundle and then tell <code>git fetch</code> to grab the changes from it:</p>
<pre class="brush: plain; highlight: [1,7,12]; light: true; title: ; notranslate">
% git bundle verify /media/usbstick/changes.bundle
The bundle contains 1 ref
7a1d2087f10e6db33e6b4a28e2c427b65238a62c refs/heads/mybranch
The bundle requires these 1 ref
6f5fced94ef76f1b46e259db72ad6fc39c49ba72 
/media/usbstick/changes.bundle is okay
% git fetch /media/usbstick/changes.bundle mybranch
Receiving objects: 100% (3/3), done.
Resolving deltas: 100% (2/2), completed with 2 local objects.
From /media/usbstick/changes.bundle
 * branch            mybranch   -&gt; FETCH_HEAD
% git merge FETCH_HEAD
Updating 6f5fced..7a1d208
Fast-forward
 README |    2 ++
 1 file changed, 2 insertions(+)
</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/gholms.wordpress.com/194/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/gholms.wordpress.com/194/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.devzero.com&#038;blog=34711895&#038;post=194&#038;subd=gholms&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://blog.devzero.com/2012/06/08/git-pull-via-sneakernet/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/caf2eac128e90a3dee3e67e313fd2d02?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">gholms</media:title>
		</media:content>
	</item>
	</channel>
</rss>
