projects
/
osm
/
devops.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix pyyaml dependency after new juju verson
[osm/devops.git]
/
descriptor-packages
/
tools
/
generate_descriptor_pkg.sh
diff --git
a/descriptor-packages/tools/generate_descriptor_pkg.sh
b/descriptor-packages/tools/generate_descriptor_pkg.sh
index
1a30cf1
..
1b9a9e0
100755
(executable)
--- a/
descriptor-packages/tools/generate_descriptor_pkg.sh
+++ b/
descriptor-packages/tools/generate_descriptor_pkg.sh
@@
-43,10
+43,11
@@
VNFD_FOLDERS=(images scripts icons charms cloud_init)
# Supported folders for NSD
# OSM document specifies (ns|vnf)-config folder, while Rel 4.3
# is using (ns|vnf)_config.
# Supported folders for NSD
# OSM document specifies (ns|vnf)-config folder, while Rel 4.3
# is using (ns|vnf)_config.
-NSD_FOLDERS=(scripts icons ns_config vnf_config)
+NSD_FOLDERS=(scripts
charms
icons ns_config vnf_config)
# Other files allowed in the descriptor base directory
ALLOWED_FILES=(README)
# Other files allowed in the descriptor base directory
ALLOWED_FILES=(README)
+ALLOWED_FILES_WILDCARDS=(README)
DESC_TYPES=(vnfd nsd)
DESC_EXTN=(yml yaml json xml)
DESC_TYPES=(vnfd nsd)
DESC_EXTN=(yml yaml json xml)
@@
-61,7
+62,7
@@
DEBUG=false
ARCHIVE=false
CREATE_NSD=false
VENDOR='OSM'
ARCHIVE=false
CREATE_NSD=false
VENDOR='OSM'
-INTF_TYPE='
VIRTIO
'
+INTF_TYPE='
PARAVIRT
'
VCPU=2
MEMORY=4096
STORAGE=10
VCPU=2
MEMORY=4096
STORAGE=10
@@
-98,8
+99,8
@@
Usage:
--vendor : Vendor name for descriptor. Default OSM
--vendor : Vendor name for descriptor. Default OSM
- --interface-type : Interface type [
VIRTIO
|SR-IOV|PCI-PASSTHROUGH|E1000]
- Default
VIRTIO
+ --interface-type : Interface type [
PARAVIRT
|SR-IOV|PCI-PASSTHROUGH|E1000]
+ Default
PARAVIRT
VM Flavour options:
VM Flavour options:
@@
-137,7
+138,7
@@
EOF
CP_TYPE='VPORT'
function get_cp_type() {
case ${INTF_TYPE} in
CP_TYPE='VPORT'
function get_cp_type() {
case ${INTF_TYPE} in
-
VIRTIO
) CP_TYPE='VPORT';;
+
PARAVIRT
) CP_TYPE='VPORT';;
SR-IOV ) CP_TYPE='VPORT';;
PCI-PASSTHROUGH ) CP_TYPE='VPORT';;
OM-MGMT ) CP_TYPE='VPORT';;
SR-IOV ) CP_TYPE='VPORT';;
PCI-PASSTHROUGH ) CP_TYPE='VPORT';;
OM-MGMT ) CP_TYPE='VPORT';;
@@
-230,7
+231,7
@@
EOF
- name: eth0
type: EXTERNAL
virtual-interface:
- name: eth0
type: EXTERNAL
virtual-interface:
- type:
VIRTIO
+ type:
PARAVIRT
external-connection-point-ref: vnf-cp0
EOF
external-connection-point-ref: vnf-cp0
EOF
@@
-256,7
+257,6
@@
EOF
eth=$(($i))
cat >>$desc_file <<EOF
- name: vnf-cp${eth}
eth=$(($i))
cat >>$desc_file <<EOF
- name: vnf-cp${eth}
- type: ${CP_TYPE}
EOF
done
EOF
done
@@
-757,7
+757,11
@@
if [ $CREATE == false ]; then
for f in ${files[@]}; do
if [ $(contains "${ALLOWED_FILES[@]}" $f) == "n" ]; then
for f in ${files[@]}; do
if [ $(contains "${ALLOWED_FILES[@]}" $f) == "n" ]; then
- echo "WARN: Unsupported file $f found"
+ for j in ${ALLOWED_FILES_WILDCARDS[@]}; do
+ if [[ $f != *"$j"* ]]; then
+ echo "WARN: Unsupported file $f found"
+ fi
+ done
fi
done
fi
done
@@
-791,6
+795,14
@@
if [ $CREATE == false ]; then
fi
cd $BASE_DIR
fi
cd $BASE_DIR
+ # Mrityunjay Yadav: Validate descriptor
+ GEN_BASEDIR=$(dirname "$0")
+ python3 $GEN_BASEDIR/validate_descriptor.py $BASE_DIR/$PKG/$descriptor
+ if [ $? -ne 0 ]; then
+ rc=$?
+ echo "ERROR: validating descriptor for $PKG ($rc)" >&2
+ exit $rc
+ fi
if [ $DRY_RUN == false ]; then
if [ $VERBOSE == true ]; then
tar zcvf "$DEST_DIR/$PKG.tar.gz" "${PKG}" ${RM}
if [ $DRY_RUN == false ]; then
if [ $VERBOSE == true ]; then
tar zcvf "$DEST_DIR/$PKG.tar.gz" "${PKG}" ${RM}