171 Commits

Author SHA1 Message Date
Edward Hope-Morley
9e2af26b6d Make image location ops policy configurable
Some users may not want *_image_location operations to be
restricted to role:admin so this patch allows that to be
configurable and sets the default to be False since
enabling this by default is breaking RBD COW clones in
Nova for non-admin users (and anywhere else that relies
on that information).

Change-Id: I8c293d6036bc1d6104dab5458f6915968459a09e
Closes-Bug: #1786144
2018-08-31 15:44:00 +01:00
Liam Young
19aaffaa81 Update to run under Python 3
Updating charm to support execution under Python 3.

Change-Id: I1429d1c6b634959e0062a8e9f4bc615c58bf31e0
2018-08-01 14:11:56 +02:00
James Page
4d1d7f5a3f Fix keystone v3 support with swift backend
Refactor configuration for mitaka onwards, where the
authentication details for swift storage are in a new
glance-swift.conf configuration file.

Update for Keystone v3 support as required for
queens or later, where the v2 API has been dropped.

Closes-Bug: 1752027
Depends-On: Ie6e2733f34de10a4d34b18dbf1fd9ba623af0e18
Change-Id: Ibcc36ca22d72d310921f840e6081608be1fbc7e1
2018-02-28 08:55:08 +00:00
Billy Olsen
5030d244e2 Use VolumeAPIContext for endpoint
Switch to use the VolumeAPIContext for determining the endpoint
which is used for communicating with the Cinder volume API.

Change-Id: I15c326caf5561463fc25ee879cee0ed7b8dfd09e
Related-Bug: #1733566
2018-02-08 18:43:10 -07:00
Zuul
f202d93c5b Merge "Remove deploy from source support" 2018-01-12 14:50:18 +00:00
James Page
bd7375104e Remove deploy from source support
Drop support for deployment from Git repositories, as deprecated
in the 17.02 charm release.  This feature is unmaintained and has
no known users.

Change-Id: Ic9a74991973863b2cf61fc5368bbe3664af90ef4
2018-01-08 15:11:54 +00:00
James Page
f45e5edeed Drop postgresql support
Remove postgresql DB support; This feature is untested as part
of the charms, is not in use and was deprecated as part of
the 1708 charms release.

Change-Id: Ia197a37cbfe9c11538f272437d95cfc836768cc9
2017-12-21 11:59:07 +00:00
Jorge Niedbalski
b95ad9c023 Restrict get_image_location policy to role:admin
This patch will cause /etc/glance/policy.json to
be updated so that *_image_location rules are
set to role:admin so that only admins can see
that info. On first update the original values are
stored on the local kvstore in case they need to
be retrieved for later restoring or comparison.

Closes-Bug: #1699565
Change-Id: Id6198d534af95013af47c0c1292ac65c79470af4
2017-12-12 22:05:24 +00:00
Edward Hope-Morley
f0f70a942b Use volumev3 for internal endpoint in >= Pike
volumev2 api is deprecated for >= Pike so select
volumev3 for internal endpoint when using >= Pike.

Also moved cinder_catalog_info config to
[glance_store] section which should have been done
a long time ago.

Change-Id: Ia9c002199d939ba20c029b70d2eb3c6b6cdc51a6
Partial-Bug: #1733566
2017-12-11 11:09:13 +00:00
Liam Young
f62513ad06 Expose {disk,container}_format options
The disk_format option was hardcoded and the container_format option
was unset. This change exposes both to the user allowing the admin
to restrict what formats are uploaded.

Closes-Bug# 1570875

Change-Id: I19fdc75b30863e997affb2dc90b0dd3bd19c9d27
2017-09-22 14:40:36 +00:00
Corey Bryant
624c77ca59 Reset os_release cached value after upgrade
In enable_memcache, ensure that the os_release cache is reset
after upgrade.

Change-Id: Id4d2a7f2d9c83550c0f82130306a21da7073549f
Partial-Bug: 1715624
2017-09-07 21:37:33 +00:00
Alex Kavanagh
e8a4b29784 Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done

Change-Id: I6851849b8107e59e9e6ff529348c7b183d36266b
Related-Bug: #1659575
2017-04-27 09:33:06 +01:00
Liam Young
121ee44911 Enable Memcache service for Token Caching
With the release of 4.2.0 of keystonemiddleware using the
in-process token cache is no longer recommended. It is recommended
that a memcache backend to store tokens is used instead,

This installs and configures memcache and configures glance
to use memcache for token caching.

http://docs.openstack.org/releasenotes/keystonemiddleware/mitaka.html#id2

Change-Id: If1a95fbd4e5771eaad937573dd4ee28750080218
2016-12-13 16:36:54 +00:00
James Page
7b77a4c57a Add support for application version
Juju 2.0 provides support for display of the version of
an application deployed by a charm in juju status.

Insert the os_application_version_set function into the
existing assess_status function - this gets called after
all hook executions, and periodically after that, so any
changes in package versions due to normal system updates
will also be reflected in the status output.

This review also includes a resync of charm-helpers to
pickup hookenv and contrib.openstack support for this
feature.

Change-Id: I059d03fd0ae0c445b5822b3e48476e54b839689d
2016-09-20 12:11:44 +01:00
Andrey Pavlov
2b3eea98eb Allow to provide configuration for specific cinder backend
This changeset allows to change default store to cinder
and define additional key/values for glance-api.conf file.
Some cinder backends could require additional changes
in service and additional changes in the OS.
Same functionality implemented in cinder charm via storage-backend interface.

Change-Id: Ia9c78df7e9a1ccb0d9ca2121dd01e5832186bf19
2016-08-26 17:21:11 +03:00
Andrey Pavlov
fa1c1dda1c Add support for storage of images in Cinder
Glance charm allows to store images in file, ceph, swift.

This changeset adds support for storage of images in Cinder
for OpenStack Mitaka or later.

Required dependencies are installed on relation to Cinder
(inline with Ceph integration).

This feature is dependent on resolution of some packaging
issues in the glance-store package (see Related-Bug).

Related-Bug: 1609733

Change-Id: Ib9d9f28e040b7b2eebb3f5d0ee9ff0773292bdcc
2016-08-24 10:56:55 +01:00
Corey Bryant
ad8888b09b Properly install rados and rbd python bindings for client libraries.
Change-Id: Ica140e90e15b98a979edfed2db8b452a7eaafb68
2016-07-21 18:43:53 +00:00
James Page
b5af23bd20 Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

Change-Id: I929c0635f3e7c7545d654e33194a751d197c3ca5
2016-07-01 17:23:19 +01:00
Corey Bryant
74e10c82d4 Add defaults for openstack-origin-git config option
openstack-origin-git currently only supports YAML that specifies
the git repositories to deploy from.

This adds support for default openstack-origin-git values. The
default values supported are: icehouse, kilo, liberty, mitaka,
and master.  For example: openstack-origin-git=master.

Change-Id: I17eebbe81053233c60687acf453b17109110993f
2016-06-20 09:07:33 -04:00
Adam Gandelman
812ae1d959 Add support for glance-api-ready relation flag
It's useful for service related to glance to know when it thinks
that its ready to start accepting requests, so that images can
be uploaded into Glance by other services in the cloud.

Add a 'glance-api-ready' flag to the image-service relation and
set status based on required interfaces being complete.

Change-Id: I28eba6f5fbc009b3c1e07a1180a85ddd17939404
Partial-Bug: 1528390
2016-06-16 17:26:11 +01:00
Jenkins
c5ac61f368 Merge "Add systemd init support for deploy from source" 2016-06-14 10:53:05 +00:00
Corey Bryant
8b49c92fc2 Add systemd init support for deploy from source
systemd is used instead of upstart by default since Ubuntu 15.10
(Wily).  This adds systemd init file support for glance services
that are deployed from source.

Change-Id: I4117e9cbe5a30ed19ef2976d4e7160b82c09d4d3
2016-06-08 18:41:29 +00:00
Alex Kavanagh
1ab2c809ad Fix for status-set race - related to bug 1588462
This change fixes the obvious race for a status_set() between
check_optional_interfaces() and assess_status() as the later calls the former
which calls status_set(), returns the status, which is then potentially set
again by the assess_status() function.  This cleans up the code so that only a
single status_set() is performed when calling assess_status().

Change-Id: I06efbcaade8f0c99b5931104e6887d24cb10e35a
Related-Bug:#1588462
2016-06-05 12:57:53 +00:00
Edward Hope-Morley
063f3a44f0 Support using internal network for clients
Openstack mostly defaults to using public endpoints for
internal communication between services. This patch adds
a new option use-internal-endpoints which, if set to True,
will configure services to use internal endpoints where
possible.

Closes-Bug: 1456876
Change-Id: I76129d4def671c5a5001cf15d9ff629a94a450e0
2016-04-01 12:13:20 +01:00
Alex Kavanagh
d4cf177cc5 Enhanced pause and resume for maintenance mode
Adds improved pause and resume unit to the charm such tha the
charm stays paused during maintenance operations.
Sync latest version of charm-helpers for maintenance mode.

Change-Id: I6e793744709b65c89afb6f0fc460f9d96755bf82
2016-03-18 10:18:56 +00:00
James Page
a8f380b4cf Drop charm supplied paste.ini configurations
The glance-api-paste.ini and glance-registry-paste.ini configuration
files provided as part of the glance packages should be used; drop
charm templates and associated code paths.

This was required in early OpenStack versions where keystone auth
credentials where rendered into the paste ini file.

Existing deployments will go through a upgrade step to replace the
previously provided paste files from the charm with those provided
by the glance-api and glance-registry packages.

Change-Id: I016b8cb7823b98e8dffa91b3b427ed88a7b619bc
2016-03-10 11:46:02 +00:00
Liam Young
9d4bc8ee4c Late import requests 2016-01-27 12:41:15 +00:00
Liam Young
863d1fae91 If the swift proxy servers are down the swift client throws requests.exceptions.ConnectionError not exceptions.ClientException 2016-01-26 16:51:44 +00:00
Ryan Beisner
47f0d13714 fix import error, log a bit more 2016-01-21 18:53:31 +00:00
James Page
3bb7aadbd3 Retry temp_url generation, move existing retry to correct function. 2016-01-21 16:22:07 +00:00
Alex Kavanagh
842eabd67c Updates to code following comments from Liam Young:
assess_status() now uses set_os_workload_status() if he unit is not
explicitly paused.
2016-01-13 14:31:40 +00:00
Alex Kavanagh
4647c41535 change pause/resume actions use (new) assess_status()
Implemented new is_paused() and assess_status() functions, and changed
the pause and resume actions to use them.  Changed existing and added new
tests to verify functionality.  Note changed any of the other status_set()
functions.
2016-01-12 15:25:56 +00:00
Ionut Balutoiu
c08a78477f Added swift-temp-url-key parameter needed when creating temporary urls from glance 2015-10-31 00:11:38 +02:00
David Ames
2425fac04f Make messaging an optional relation for workload status 2015-10-06 07:55:52 -07:00
David Ames
855d82d259 [thedac, trivial] s/message/messaging 2015-10-02 14:27:28 -07:00
Liam Young
f6487c0378 [thedac,r=gnuoy] Workload Status 2015-09-29 16:49:04 +01:00
David Ames
bb419109dc Allow for swift storage-backend 2015-09-28 11:16:43 -07:00
David Ames
69fc9799c1 Use check_optional_relations 2015-09-25 16:25:10 -07:00
David Ames
ef93d075f7 Glance has no zeromq option 2015-09-25 10:19:23 -07:00
Edward Hope-Morley
57e2fc14a1 [hopem,r=]
No more trusty-backports for haproxy >= Liberty

Closes-Bug: 1499435
2015-09-24 17:31:35 +01:00
David Ames
dc2a764560 Workgroup status 2015-09-23 16:12:35 -07:00
James Page
9f6b58ca85 Ensure python2 is installed before hook execution 2015-09-22 14:39:12 +01:00
Alberto Donato
6d1ca9298f Fix import. 2015-08-27 14:58:12 +03:00
Alberto Donato
ac4d7db97a Fix tests again. 2015-08-27 14:44:11 +03:00
Alberto Donato
62e449c2b2 Fix service list. 2015-08-26 16:16:31 +03:00
Alberto Donato
53858d418c Fix more imports. 2015-08-25 17:59:31 +03:00
Alberto Donato
5440ba8c4a Rework method. 2015-08-25 17:54:37 +03:00
Liam Young
3706bff3a0 Resync le charm helpers 2015-06-04 09:44:46 +01:00
Corey Bryant
885d0a5496 Add libyaml-dev as base git package 2015-05-12 19:46:43 +00:00
Corey Bryant
a86c379b97 Add comment to fix bin symlinks 2015-05-11 12:36:06 +00:00