Skip to content

Commit

Permalink
Merge pull request #1773 from jrha/cleanup-openstack
Browse files Browse the repository at this point in the history
ncm-openstack: Fix wrapping and indentation in pan
  • Loading branch information
wpoely86 authored Dec 9, 2024
2 parents 676ed76 + 1be8321 commit 288c473
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 39 deletions.
4 changes: 2 additions & 2 deletions ncm-openstack/src/main/pan/components/openstack/catalog.pan
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ declaration template components/openstack/catalog;

include 'components/openstack/catalog/murano';

@documentation {
Type to define OpenStack catalog services
@documentation{
Type to define OpenStack catalog services
}
type openstack_catalog_config = {
'murano' ? openstack_murano_config
Expand Down
3 changes: 2 additions & 1 deletion ncm-openstack/src/main/pan/components/openstack/common.pan
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ type openstack_tunnel_types = string with match(SELF, '^(vxlan|gre)$');
type openstack_neutron_mechanism_drivers = string with match(SELF, '^(linuxbridge|l2population|openvswitch)$');

type openstack_neutron_firewall_driver = string with match(SELF,
'^(neutron.agent.linux.iptables_firewall.IptablesFirewallDriver|openvswitch|iptables_hybrid|iptables)$');
'^(neutron.agent.linux.iptables_firewall.IptablesFirewallDriver|openvswitch|iptables_hybrid|iptables)$'
);

type openstack_share_backends = string with match(SELF, '^(lvm|generic|cephfsnative|cephfsnfs)$');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ declaration template components/openstack/compute/nova;
include 'components/openstack/identity';

type openstack_disk_cachemodes = string with match(SELF,
'^((file=|block=|network=)(default|none|writethrough|writeback|directsync|unsafe))$');
'^((file=|block=|network=)(default|none|writethrough|writeback|directsync|unsafe))$'
);

@documentation{
The Nova configuration options in "api_database" Section.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ declaration template components/openstack/container-infra;

include 'components/openstack/container-infra/magnum';

@documentation {
Type to define OpenStack container orchestration engine
@documentation{
Type to define OpenStack container orchestration engine
}
type openstack_container_infra_config = {
'magnum' ? openstack_magnum_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@

declaration template components/openstack/dashboard/horizon;

type openstack_horizon_session_engine = choice('django.contrib.sessions.backends.cache',
'django.contrib.sessions.backends.db');
type openstack_horizon_session_engine = choice(
'django.contrib.sessions.backends.cache',
'django.contrib.sessions.backends.db'
);

@documentation{
The Horizon configuration options in "caches" Section.
Expand Down Expand Up @@ -270,10 +272,10 @@ type openstack_horizon_config_identity_keystone = {
found = true;
};
};
if (!found) {
error("available_regions %s require openstack_keystone_url %s to be one of the regions",
SELF['available_regions'], def);
};
if (!found) error(
"available_regions %s require openstack_keystone_url %s to be one of the regions",
SELF['available_regions'], def,
);
};
true;
};
Expand Down Expand Up @@ -387,7 +389,7 @@ type openstack_horizon_config_general = {
'rest_api_required_settings' : string[] = list(
'OPENSTACK_HYPERVISOR_FEATURES', 'LAUNCH_INSTANCE_DEFAULTS',
'OPENSTACK_IMAGE_FORMATS', 'OPENSTACK_KEYSTONE_DEFAULT_DOMAIN',
)
)
'security_group_files' : openstack_horizon_security_group{} = dict(
'all_tcp', dict('name', 'ALL TCP', 'from_port', 1, 'to_port', 65535),
'all_udp', dict('name', 'ALL UDP', 'from_port', 1, 'to_port', 65535, 'ip_protocol', 'udp'),
Expand All @@ -406,7 +408,7 @@ type openstack_horizon_config_general = {
'ms_sql', dict('name', 'MS SQL', 'from_port', 1433, 'to_port', 1433),
'mysql', dict('name', 'MYSQL', 'from_port', 3306, 'to_port', 3306),
'rdp', dict('name', 'RDP', 'from_port', 3389, 'to_port', 3389),
)
)
'use_ssl' ? boolean
'csrf_cookie_secure' ? boolean
'session_cookie_secure' ? boolean
Expand Down
31 changes: 16 additions & 15 deletions ncm-openstack/src/main/pan/components/openstack/identity/gather.pan
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ function openstack_vivify = {
if (idx > 0) {
if (exists(current[arg])) {
value = current[arg];
if (!is_dict(value)) {
error("%s: existing key %s found, but is not a dict (%s)",
FUNCTION, arg, value);
};
if (!is_dict(value)) error(
"%s: existing key %s found, but is not a dict (%s)",
FUNCTION, arg, value,
);
} else {
current[arg] = dict();
};
Expand All @@ -42,10 +42,10 @@ function openstack_merge = {

if (exists(data[key])) {
foreach (k; v; values) {
if (data[key][k] != v) {
error("%s: %s %s has different existing value %s (expected %s) (whole section %s)",
FUNCTION, msg, key, data[key][k], v, data[key]);
};
if (data[key][k] != v) error(
"%s: %s %s has different existing value %s (expected %s) (whole section %s)",
FUNCTION, msg, key, data[key][k], v, data[key],
);
};
} else {
data[key] = values;
Expand Down Expand Up @@ -91,7 +91,7 @@ function openstack_identity_gather_service_add = {
name,
dict('type', srvdata['type'], 'description', sdescr),
msg,
);
);

# internal first, to make the default for the others
foreach (idx; intf; list('internal', 'public', 'admin')) {
Expand Down Expand Up @@ -153,7 +153,7 @@ function openstack_identity_gather_service = {
user,
dict('password', pwd, 'domain_id', domain, 'description', udescr),
format("host %s service %s", host, service)
);
);

data_r = openstack_vivify(data, 'rolemap', 'project', 'service', 'user');
data_r[user] = append(data_r[user], 'admin');
Expand Down Expand Up @@ -182,7 +182,7 @@ function openstack_identity_gather_service = {
qsrv,
dict(), # no defaults
srvmsg,
);
);
if (exists(qt['services'])) {
foreach (name; srvdata; qt['services']) {
openstack_identity_gather_service_add(
Expand All @@ -191,7 +191,7 @@ function openstack_identity_gather_service = {
srvdata,
qsrv['internal'],
format("%s extra %s", srvmsg, name)
);
);
};
};
};
Expand All @@ -217,9 +217,10 @@ function openstack_identity_gather = {
data = ARGV[0];

os_component = '/software/components/openstack';
os_services = list('identity', 'network', 'compute', 'image',
'volume', 'share', 'catalog', 'orchestration', 'metric', 'rating',
'container-infra', 'key-manager');
os_services = list(
'identity', 'network', 'compute', 'image', 'volume', 'share', 'catalog', 'orchestration', 'metric', 'rating',
'container-infra', 'key-manager',
);

hosts = list(list(OBJECT, ''));
if (ARGC > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ type openstack_glance_store = {
NOTE: The value given for this configuration option must be a valid
scheme for a store registered with the ``stores`` configuration
option.}
'default_store' : choice('file', 'filesystem', 'http',
'https', 'swift', 'swift+http', 'swift+https', 'swift+config', 'rbd',
'sheepdog', 'cinder', 'vsphere') = 'file'
'default_store' : choice(
'file', 'filesystem', 'http', 'https', 'swift', 'swift+http', 'swift+https', 'swift+config', 'rbd',
'sheepdog', 'cinder', 'vsphere'
) = 'file'
@{Directory to which the filesystem backend store writes images.
Upon start up, Glance creates the directory if it does not already
exist and verifies write access to the user under which
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ declaration template components/openstack/key-manager;

include 'components/openstack/key-manager/barbican';

@documentation {
Type to define OpenStack Key Manager service
@documentation{
Type to define OpenStack Key Manager service
}
type openstack_key_manager_config = {
'barbican' ? openstack_barbican_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ declaration template components/openstack/orchestration;

include 'components/openstack/orchestration/heat';

@documentation {
Type to define OpenStack orchestration services
@documentation{
Type to define OpenStack orchestration services
}
type openstack_orchestration_config = {
'heat' ? openstack_heat_config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ declaration template components/openstack/share/manila;
include 'components/openstack/identity';


type openstack_manila_share_driver = choice('manila.share.drivers.lvm.LVMShareDriver',
'manila.share.drivers.cephfs.driver.CephFSDriver', 'manila.share.drivers.generic.GenericShareDriver');
type openstack_manila_share_driver = choice(
'manila.share.drivers.lvm.LVMShareDriver',
'manila.share.drivers.cephfs.driver.CephFSDriver',
'manila.share.drivers.generic.GenericShareDriver'
);

@documentation{
Common Manila storage backends options
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ prefix "/metaconfig/contents";
"available_regions" = list(
dict('url', 'http://controller.mysite.com:5000/v3', 'name', 'main'),
dict('url', 'http://controller.myothersite.com:5000/v3', 'name', 'other'),
);
);

0 comments on commit 288c473

Please sign in to comment.