Skip to content

Commit

Permalink
Merge pull request #1465 from GlobalNOC/2.0.17-dev
Browse files Browse the repository at this point in the history
2.0.17 dev
  • Loading branch information
jonstout authored Feb 14, 2023
2 parents c682c54 + 55d1a7e commit 5de241e
Show file tree
Hide file tree
Showing 28 changed files with 348 additions and 44 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ RABBITMQ_VHOST=/
SMTP_FROM_ADDR=oess@localhost
SMTP_FROM_NAME=OESS Notifier
SMTP_IMAGE_URL=http://localhost:8080/oess/notification-img
MAILHOST=localhost


# Optional: WebAPI details for GlobalNOC TSDS instance; Is used to
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
OESS_VERSION=2.0.16
OESS_VERSION=2.0.17
OESS_NETWORK=oess
TEST_FILES=
MAILHOST=localhost


include .env

Expand Down
2 changes: 1 addition & 1 deletion app/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME= oess-core
VERSION = 2.0.16
VERSION = 2.0.17

rpm: dist
rpmbuild -ta dist/$(NAME)-$(VERSION).tar.gz
Expand Down
4 changes: 2 additions & 2 deletions app/oess-core.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: oess-core
Version: 2.0.16
Version: 2.0.17
Release: 1%{?dist}
Summary: The core OESS service providers

Expand All @@ -20,7 +20,7 @@ Requires: /bin/bash
Requires: /usr/bin/perl
Requires: perl(base), perl(constant), perl(strict), perl(warnings)

Requires: perl-OESS >= 2.0.16
Requires: perl-OESS >= 2.0.17

Requires: perl(AnyEvent), perl(AnyEvent::DBus), perl(AnyEvent::RabbitMQ)
Requires: perl(CPAN), perl(CPAN::Shell)
Expand Down
2 changes: 1 addition & 1 deletion frontend/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME= oess-frontend
VERSION = 2.0.16
VERSION = 2.0.17

rpm: dist
rpmbuild -ta dist/$(NAME)-$(VERSION).tar.gz
Expand Down
6 changes: 3 additions & 3 deletions frontend/oess-frontend.spec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: oess-frontend
Version: 2.0.16
Version: 2.0.17
Release: 1%{?dist}
Summary: The OESS webservices and user interface

Expand All @@ -14,14 +14,14 @@ BuildRequires: python >= 2.6, python-libs >= 2.6
BuildRequires: python-simplejson
BuildRequires: rh-nodejs8-nodejs == 8.11.4

Requires: oess-core >= 2.0.16
Requires: oess-core >= 2.0.17
Requires: yui
Requires: httpd, mod_ssl
Requires: nddi-tiles
Requires: perl-Crypt-SSLeay
Requires: xmlsec1, xmlsec1-openssl

Requires: perl-OESS >= 2.0.16
Requires: perl-OESS >= 2.0.17

Requires: perl(strict), perl(warnings)
Requires: perl(AnyEvent)
Expand Down
2 changes: 1 addition & 1 deletion frontend/webservice/entity.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ sub get_entities{
foreach my $acl (@{$int->acls()}){
next if (!defined $acl->{'entity_id'}) || ($acl->{'entity_id'} != $entity->entity_id);
next if (!defined $acl->{'allow_deny'}) || ($acl->{'allow_deny'} ne 'allow');
next if (!defined $acl->{'workgroup_id'}) || ($acl->{'workgroup_id'} != $workgroup_id);
next if (defined($acl->{'workgroup_id'}) && $acl->{'workgroup_id'} != $workgroup_id);

for (my $i=$acl->{'start'}; $i<=$acl->{'end'}; $i++) {
if ($int->vlan_valid(workgroup_id => $workgroup_id, vlan => $i)) {
Expand Down
3 changes: 2 additions & 1 deletion frontend/www/html_templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
</ul>
</li>
<li><a href="[% path %]index.cgi?action=phonebook">Explore</a></li>
<li><a href="[% path %]index.cgi?action=acl">Workgroup</a></li>
<li><a href="[% path %]index.cgi?action=acl">Interface ACLs</a></li>
<li><a href="[% path %]../grouper-ui" target="_blank">Workgroup Management</a></li>
</ul>

<ul class="nav navbar-nav navbar-right">
Expand Down
3 changes: 2 additions & 1 deletion frontend/www/new/admin_new/src/components/nav_bar/NavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ export default class NavBar extends React.Component{
<NavLink linkTo={`${path}/index.cgi?action=provision_cloud`} text="Layer 3" />
</NavDropdown>
<NavLink linkTo={`${path}/index.cgi?action=phonebook`} text="Explore" />
<NavLink linkTo={`${path}/index.cgi?action=acl`} text="Workgroup" />
<NavLink linkTo={`${path}/index.cgi?action=acl`} text="Interface ACLs" />
<NavLink linkTo={`${path}/../../grouper-ui`} target="_blank" text="Workgroup Management" />
</ul>
<ul className="nav navbar-nav navbar-right">
{adminLink}
Expand Down
4 changes: 2 additions & 2 deletions frontend/www/new/admin_new/src/components/nav_bar/NavLink.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import React from 'react';
export default class NavLink extends React.Component{
render() {
if (this.props.children) {
return <li onClick={this.props.onClick}><a href={this.props.linkTo}>{this.props.children}</a></li>;
return <li onClick={this.props.onClick}><a href={this.props.linkTo} target={this.props.target ? this.props.target : null}>{this.props.children}</a></li>;
}
return <li onClick={this.props.onClick}><a href={this.props.linkTo}>{this.props.text}</a></li>;
return <li onClick={this.props.onClick}><a href={this.props.linkTo} target={this.props.target ? this.props.target : null}>{this.props.text}</a></li>;
}
}
6 changes: 3 additions & 3 deletions oess.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Summary: OESS Metapackage
Name: oess
Version: 2.0.16
Version: 2.0.17
Release: 1%{?dist}
License: Apache
Group: GRNOC
#Source:
URL: http://globalnoc.iu.edu
Buildroot: %{_tmppath}/%{name}-root
Requires: oess-core >= 2.0.16
Requires: oess-frontend >= 2.0.16
Requires: oess-core >= 2.0.17
Requires: oess-frontend >= 2.0.17

%description
Package that installs all of the OESS packages
Expand Down
3 changes: 2 additions & 1 deletion perl-lib/OESS/MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ lib/OESS/Webservice.pm
lib/OESS/Workgroup.pm
Makefile.PL
MANIFEST This list of files
perl-OESS-2.0.16.tar.gz
perl-OESS-2.0.17.tar.gz
perl-OESS.spec
share/customer-templates/cisco/2900/ios124/template.txt
share/customer-templates/cisco/3700/ios124/template.txt
Expand Down Expand Up @@ -157,6 +157,7 @@ share/upgrade/oess-2.0.12-2.0.13
share/upgrade/oess-2.0.13-2.0.14
share/upgrade/oess-2.0.14-2.0.15
share/upgrade/oess-2.0.15-2.0.16
share/upgrade/oess-2.0.16-2.0.17
share/upgrade/oess-2.0.2-2.0.3
share/upgrade/oess-2.0.3-2.0.4
share/upgrade/oess-2.0.4-2.0.5
Expand Down
5 changes: 4 additions & 1 deletion perl-lib/OESS/lib/OESS/Cloud.pm
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,10 @@ sub setup_endpoints {
# Configure peering information only on layer 3
# connections.
my $conn = $azure->expressRouteCrossConnection($ep->cloud_interconnect_id, $ep->cloud_account_id);
my $peering = $azure_peering_config->cross_connection_peering($ep->cloud_account_id);
my $peering;
if (defined $vrf_id) {
$peering = $azure_peering_config->cross_connection_peering($ep->cloud_account_id);
}

# Validate that configured bandwidth reservation allowed
my $ep_intf = new OESS::Interface(db => $ep->{db}, interface_id => $ep->interface_id);
Expand Down
2 changes: 1 addition & 1 deletion perl-lib/OESS/lib/OESS/Cloud/Azure.pm
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ sub set_cross_connection_state_to_provisioned {
bandwidthInMbps => $args->{bandwidth},
expressRouteCircuit => { id => $args->{circuit_id} },
peeringLocation => $args->{peering_location},
peerings => [],
# peerings => undef, Historically not included
serviceProviderProvisioningState => 'Provisioned',
}
};
Expand Down
2 changes: 1 addition & 1 deletion perl-lib/OESS/lib/OESS/Cloud/AzurePeeringConfig.pm
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ sub cross_connection_peering {
$result->{primaryPeerAddressPrefix} = $self->primary_prefix($service, 'ipv4');
$result->{secondaryPeerAddressPrefix} = $self->secondary_prefix($service, 'ipv4');
$result->{state} = 'Enabled';
$result->{peeringType} = 'AzurePrivatePeering';
# $result->{peeringType} = 'AzurePrivatePeering'; Historically not included
}

# I thought IPv6 support was added but it's not fully implemented.
Expand Down
4 changes: 3 additions & 1 deletion perl-lib/OESS/lib/OESS/Cloud/Oracle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ sub new {
}
$self->{base_url} = $self->{config_obj}->oracle()->{$self->{interconnect_id}}->{base_url};
$self->{compartment_id} = $self->{config_obj}->oracle()->{$self->{interconnect_id}}->{compartment_id};
$self->{public_key} = $self->{config_obj}->oracle()->{$self->{interconnect_id}}->{public_key};
$self->{private_key} = $self->{config_obj}->oracle()->{$self->{interconnect_id}}->{private_key};

# We intercept and sign every request sent using $self->{conn} via the
# request_send handler. https://metacpan.org/pod/LWP::UserAgent#add_handler
Expand Down Expand Up @@ -166,7 +168,7 @@ sub _compute_signature {
# my $signature = $rsa->sign($signing_string);
# return encode_base64($signature);

return `printf '%b' "$signing_string" | openssl dgst -sha256 -sign /etc/oess/oracle_rsa | openssl enc -e -base64 | tr -d '\n'`;
return `printf '%b' "$signing_string" | openssl dgst -sha256 -sign $self->{private_key} | openssl enc -e -base64 | tr -d '\n'`;
}

=head2 get_virtual_circuit
Expand Down
6 changes: 3 additions & 3 deletions perl-lib/OESS/lib/OESS/Database.pm
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ OESS::Database - Database Interaction Module
=head1 VERSION
Version 2.0.16
Version 2.0.17
=cut

our $VERSION = '2.0.16';
our $VERSION = '2.0.17';

=head1 SYNOPSIS
Expand Down Expand Up @@ -84,7 +84,7 @@ use Data::Dumper;

use Socket qw( inet_aton inet_ntoa);

use constant VERSION => '2.0.16';
use constant VERSION => '2.0.17';
use constant MAX_VLAN_TAG => 4096;
use constant MIN_VLAN_TAG => 1;
use constant OESS_PW_FILE => "/etc/oess/.passwd.xml";
Expand Down
27 changes: 23 additions & 4 deletions perl-lib/OESS/lib/OESS/Mock.pm
Original file line number Diff line number Diff line change
Expand Up @@ -92,22 +92,41 @@ sub sub_called {
return undef;
}

sub AUTOLOAD {
=head2 sub_called_config
my $hash = sub_called_config(
name => 'sum'
);
sub_called_config returns a hash of the registered subs config along
with the most recently used arguments.
=cut
sub sub_called_config {
my $self = shift;
my %args = @_;

my $name = $args{name};

return $self->{$name};
}

sub AUTOLOAD {
my $self = shift;
my @args = @_;

my @sub = split('::', $AUTOLOAD);
my $name = $sub[@sub - 1];

if (!defined $self->{$name}) {
$self->{$name} = {
args => \%args,
args => \@args,
count => 0,
result => undef
result => undef,
};
}

$self->{$name}->{args} = \%args;
$self->{$name}->{args} = \@args;
$self->{$name}->{count} += 1;
return $self->{$name}->{result};
}
Expand Down
2 changes: 1 addition & 1 deletion perl-lib/OESS/perl-OESS.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Summary: OESS Perl Libraries
Name: perl-OESS
Version: 2.0.16
Version: 2.0.17
Release: 1%{?dist}
License: APL 2.0
Group: Network
Expand Down
2 changes: 1 addition & 1 deletion perl-lib/OESS/share/nddi.sql
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ CREATE TABLE `oess_version` (

LOCK TABLES `oess_version` WRITE;
/*!40000 ALTER TABLE `oess_version` DISABLE KEYS */;
INSERT INTO `oess_version` VALUES ('2.0.16');
INSERT INTO `oess_version` VALUES ('2.0.17');
/*!40000 ALTER TABLE `oess_version` ENABLE KEYS */;
UNLOCK TABLES;

Expand Down
88 changes: 88 additions & 0 deletions perl-lib/OESS/share/upgrade/oess-2.0.16-2.0.17
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#!/usr/bin/perl
#-------------------------------------------------------------------
#----- OESS 2.0.16 - 2.0.17 upgrade module
#-----
#----- Copyright(C) 2010 The Trustees of Indiana University
#--------------------------------------------------------------------
#----- $HeadURL: $
#----- $Id: $
#-----
#----- This is run when upgrading the database from
#----- version 2.0.16 to version 2.0.17
#--------------------------------------------------------------------

use strict;
use warnings;
use OESS::Database;

my $prev_version = "2.0.16";
my $version = "2.0.17";

sub main{
print "*******************************************************************\n";
print "********* OESS DB UPGRADE ************\n";
print "*******************************************************************\n";
print "********* This will upgrade from $prev_version to $version **********\n";
print "********* of the OESS DB any other version will not work ************\n";

continue_parameter("Do you wish to continue");

my $dbq = new OESS::Database();
my $current_version = $dbq->get_oess_schema_version();
if($current_version eq $prev_version){
eval {
$dbq->{'dbh'}->begin_work();
upgrade($dbq);
$dbq->{'dbh'}->commit();
};
if ($@) {
$dbq->{'dbh'}->rollback();
print "$@\n";
exit;
}
} else{
print "Wrong version of OESS DB\n";
print "This script only upgrades from version $prev_version to $version\n";
exit;
}

print STDERR "Upgrade Successful!!\n";
}

sub upgrade{
my $dbq = shift;
my $term = shift;
my $dbh = $dbq->{'dbh'};
my $str;
my $sth;

$str = "update oess_version set version = '$version'";
$sth = $dbh->prepare($str) or die "Unable to prepare version update \n";
$sth->execute() or die "Unable to update version\n";
}

main();

sub continue_parameter {
my $name = shift;

print "$name [y/n]: ";
my $yes_or_no = <>;
chomp($yes_or_no);

exit(0) if ($yes_or_no !~ /y/i || $yes_or_no =~ /n/i);
}

sub required_parameter {
my $name = shift;

while (1) {
print "$name (required): ";
my $response = <>;
chomp($response);

return $response if ($response);

print "\nThis option is required!\n\n";
}
}
7 changes: 5 additions & 2 deletions perl-lib/OESS/t/conf/database.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<config base_url="OESS_BASE_URL" local_as="OESS_LOCAL_ASN" snapp_config_location="t/conf/SNMP/snapp/snapp_config.xml" host="127.0.0.1" port="3306" admin_email="OESS_ADMIN_EMAIL" approval_email="OESS_APPROVAL_EMAIL" network_type="OESS_NETWORK_TYPE">
<nso username="NSO_USERNAME" password="NSO_PASSWORD" host="NSO_HOST" />
<tsds url="TSDS_URL" username="TSDS_USERNAME" password="TSDS_PASSWORD" realm="TSDS_REALM" />
<smtp from_name="SMTP_FROM_NAME" from_address="SMTP_FROM_ADDR" image_base_url="SMTP_IMAGE_URL" />
<grafana host="GRAFANA_URL">
<graph panelName="oess-l2-interface" uid="3XwigBFnk" orgId="1" panelId="2"/>
<graph panelName="oess-interface" uid="3XwigBFnk" orgId="1" panelId="2"/>
Expand Down Expand Up @@ -40,7 +41,8 @@
fingerprint="20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20"
tenancy="ocid1.tenancy.oc1..0000"
region="us-ashburn-1"
key_file="oapi.pub"
private_key="/oracle_rsa"
public_key="/oracle_rsa.pub"
interconnect_type="oracle-fast-connect"
interconnect_id="ocid1.crossconnectgroup.oc1.iad.0000"
compartment_id="ocid1.compartment.oc1..0000"
Expand All @@ -51,7 +53,8 @@
fingerprint="20:20:20:20:20:20:20:20:20:20:20:20:20:20:20:20"
tenancy="ocid1.tenancy.oc1..0000"
region="us-ashburn-1"
key_file="oapi.pub"
private_key="/oracle_rsa"
public_key="/oracle_rsa.pub"
interconnect_type="oracle-fast-connect"
interconnect_id="ocid1.crossconnectgroup.oc1.iad.0001"
compartment_id="ocid1.compartment.oc1..0000"
Expand Down
Loading

0 comments on commit 5de241e

Please sign in to comment.