~ubuntu-branches/ubuntu/raring/maas/raring-proposed

« back to all changes in this revision

Viewing changes to src/provisioningserver/testing/__init__.py

  • Committer: Package Import Robot
  • Author(s): Andres Rodriguez
  • Date: 2012-07-17 08:28:36 UTC
  • mfrom: (1.1.16)
  • Revision ID: package-import@ubuntu.com-20120717082836-ucb2vou8tqg353eq
Tags: 0.1+bzr777+dfsg-0ubuntu1
* New upstream release
* Only run 'maas' command as root. (LP: #974046)
  - debian/extras/maas: Check id.
  - debian/maas.install: Install in 'sbin'.
* debian/maas.postinst:
  - restart apache2 after everything gets processed.
  - Update version to handle upgrades.
* debian/extras/maas-provision: Add wrapper to access 'maasprovisiong'
  command line.
* debian/patches/99_temporary_fix_path.patch: Dropped. No longer needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Copyright 2012 Canonical Ltd.  This software is licensed under the
 
2
# GNU Affero General Public License version 3 (see the file LICENSE).
 
3
 
 
4
from __future__ import (
 
5
    absolute_import,
 
6
    print_function,
 
7
    unicode_literals,
 
8
    )
 
9
 
 
10
"""Testing tools for `provisioningserver`."""
 
11
 
 
12
__metaclass__ = type
 
13
__all__ = [
 
14
    "network_infos",
 
15
    ]
 
16
 
 
17
 
 
18
def network_infos(network):
 
19
    """Return a dict of info about a network.
 
20
 
 
21
    :param network: The network object from which to extract the data.
 
22
    :type network: IPNetwork.
 
23
    """
 
24
    return dict(
 
25
        subnet_mask=str(network.netmask),
 
26
        broadcast_ip=str(network.broadcast),
 
27
        ip_range_low=str(network.first),
 
28
        ip_range_high=str(network.last),
 
29
    )