<type>xml</type>
<classifier>aaa-app-config</classifier>
</artifact>
- <artifact>
- <file>${project.build.directory}/classes/initial/aaa-datastore-config.xml</file>
- <type>xml</type>
- <classifier>aaa-datastore-config</classifier>
- </artifact>
- <!-- attach convert-shiro-ini-to-rest-payload.py as an artifact -->
<artifact>
- <file>${project.build.directory}/classes/convert-shiro-ini-to-rest-payload.py</file>
- <type>py</type>
- <classifier>convert-shiro-ini</classifier>
+ <file>${project.build.directory}/classes/initial/aaa-datastore-config.xml</file>
+ <type>xml</type>
+ <classifier>aaa-datastore-config</classifier>
</artifact>
</artifacts>
</configuration>
+++ /dev/null
-#!/bin/env python
-
-#
-# Copyright (c) 2017 Inocybe Technologies and others. All rights reserved.
-#
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0 which accompanies this distribution,
-# and is available at http://www.eclipse.org/legal/epl-v10.html
-#
-
-#
-# convert-shiro-ini-to-rest-payload.py
-#
-# Used to help ease upgrades. In ODL Nitrogen, AAA related application config
-# is now done via the datastore. This allows a more cohesive experience in
-# line with the rest of the controller architecture. More information about
-# this can be found here:
-#
-# https://bugs.opendaylight.org/show_bug.cgi?id=7793
-#
-# This program assumes a correctly formatted shiro.ini file. No extra checks
-# are done on shiro.ini.
-#
-
-import sys, ConfigParser
-from xml.etree.ElementTree import Element, SubElement, tostring
-from xml.dom import minidom
-
-
-SHIRO_CONFIGURATION = "shiro-configuration"
-NS = "urn:opendaylight:aaa:app:config"
-MAIN_SECTION = "main"
-URLS_SECTION = "urls"
-
-def convert(filename):
- '''
- convert shiro.ini to a XML based representation
- '''
- config = ConfigParser.ConfigParser()
- config.optionxform = str
- config.read(filename)
- root = Element(SHIRO_CONFIGURATION)
- root.attrib['xmlns'] = NS
- for section in config.sections():
- if MAIN_SECTION in section or URLS_SECTION in section:
- for item in config.items(section):
- child = SubElement(root, section)
- k = SubElement(child, "pair-key")
- k.text = item[0]
- v = SubElement(child, "pair-value")
- v.text = item[1]
- return root
-
-def usage():
- print "Usage:"
- print "> python convert-shiro-ini-to-rest <filename>"
-
-if __name__ == '__main__':
- try:
- filename = sys.argv[1]
- et = convert(filename)
- xmlstr = minidom.parseString(tostring(et)).toprettyxml(indent=" ")
- print xmlstr
- except(IndexError):
- usage()
// 2) to allow bootstrap of the controller (first time start) since otherwise //
// configuration becomes a chicken and the egg problem. //
// //
- // If you have an existing shiro.ini file, one way you can convert it is by //
- // using the utilty script: //
- // > python bin/upgrade/convert-shiro-ini-to-rest-payload <filename> //
- // This will make a best attempt effort to create an XML payload from the given //
- // shiro.ini file, and produce the results on stdout. //
///////////////////////////////////////////////////////////////////////////////////
-->
<classifier>config</classifier>
<type>xml</type>
</dependency>
- <dependency>
- <groupId>org.opendaylight.aaa</groupId>
- <artifactId>aaa-shiro</artifactId>
- <version>${project.version}</version>
- <type>py</type>
- <classifier>convert-shiro-ini</classifier>
- </dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>features-aaa</artifactId>
<type>xml</type>
<classifier>aaa-datastore-config</classifier>
</dependency>
- <!-- a conversion utility for upgrades -->
- <dependency>
- <groupId>org.opendaylight.aaa</groupId>
- <artifactId>aaa-shiro</artifactId>
- <version>${project.version}</version>
- <type>py</type>
- <classifier>convert-shiro-ini</classifier>
- </dependency>
<!-- add in standard jetty servlets bundle which exposes all sorts of useful filters
that can be added in front of RESTCONF. -->
<dependency>
<classifier>config</classifier>
</dependency>
</dependencies>
-</project>
\ No newline at end of file
+</project>
<configfile finalname="etc/opendaylight/datastore/initial/config/aaa-datastore-config.xml">
mvn:org.opendaylight.aaa/aaa-shiro/${project.version}/xml/aaa-datastore-config
</configfile>
- <configfile finalname="bin/upgrade/convert-shiro-ini-to-rest-payload">
- mvn:org.opendaylight.aaa/aaa-shiro/${project.version}/py/convert-shiro-ini
- </configfile>
<configfile finalname="bin/idmtool">
mvn:org.opendaylight.aaa/aaa-shiro/${project.version}/py/idmtool
</configfile>