~ubuntu-branches/ubuntu/saucy/heat/saucy-updates

« back to all changes in this revision

Viewing changes to heat/openstack/common/notifier/api.py

  • Committer: Package Import Robot
  • Author(s): James Page, Chuck Short, James Page
  • Date: 2013-08-08 15:23:59 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20130808152359-9jgqjp23kssvc3x9
Tags: 2013.2~b2.a186.g2b4b248-0ubuntu1
[ Chuck Short ]
* debian/patches/rename-quantumclient.patch: Dropped no longer needed. 
* debian/control: Add python-oslo.sphinx

[ James Page ]
* New upstream snapshot.
* d/watch: Updated to track releases on launchpad.
* d/control: Drop BD in pep8, no longer required.
* d/control,rules: Drop use of openstack-pkg-tools, revert use of xz
  compression for debs.
* d/control,*.config,*.templates,po: Drop use of debconf/dbconfig-common
  to configure heat.
* d/*.upstart: Add upstart configurations for Ubuntu.
* d/p/default-kombu.patch: Switch default messaging from qpid to
  kombu.
* d/p/default-sqlite.patch: Use sqlite as default database option.
* d/control: Add python-ceilometerclient to BD's.
* d/rules: Fail package build for unit test failures.
* d/*.install: Directly install configuration files to /etc/heat.
* d/control: Update VCS locations to ubuntu-server-dev branches.
* d/heat-common.{install,manpages}: Include new binaries and associated
  manpages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
13
13
#    License for the specific language governing permissions and limitations
14
14
#    under the License.
15
15
 
 
16
import socket
16
17
import uuid
17
18
 
18
19
from oslo.config import cfg
19
20
 
20
21
from heat.openstack.common import context
21
 
from heat.openstack.common.gettextutils import _
 
22
from heat.openstack.common.gettextutils import _  # noqa
22
23
from heat.openstack.common import importutils
23
24
from heat.openstack.common import jsonutils
24
25
from heat.openstack.common import log as logging
35
36
               default='INFO',
36
37
               help='Default notification level for outgoing notifications'),
37
38
    cfg.StrOpt('default_publisher_id',
38
 
               default='$host',
 
39
               default=None,
39
40
               help='Default publisher_id for outgoing notifications'),
40
41
]
41
42
 
74
75
 
75
76
        ctxt = context.get_context_from_function_and_args(fn, args, kwarg)
76
77
        notify(ctxt,
77
 
               CONF.default_publisher_id,
 
78
               CONF.default_publisher_id or socket.gethostname(),
78
79
               name,
79
80
               CONF.default_notification_level,
80
81
               body)
84
85
 
85
86
def publisher_id(service, host=None):
86
87
    if not host:
87
 
        host = CONF.host
 
88
        try:
 
89
            host = CONF.host
 
90
        except AttributeError:
 
91
            host = CONF.default_publisher_id or socket.gethostname()
88
92
    return "%s.%s" % (service, host)
89
93
 
90
94